Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d2bf3b7

Browse files
committed
Whitespace normalization. Leaving tokenize_tests.py alone for now.
1 parent be4cbb1 commit d2bf3b7

9 files changed

Lines changed: 42 additions & 45 deletions

File tree

Lib/test/string_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def run_method_tests(test):
5656

5757
test('count', 'aaa', 3, 'a')
5858
test('count', 'aaa', 0, 'b')
59-
59+
6060
test('find', 'abcdefghiabc', 0, 'abc')
6161
test('find', 'abcdefghiabc', 9, 'abc', 1)
6262
test('find', 'abcdefghiabc', -1, 'def', 4)

Lib/test/test_charmapcodec.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def check(a, b):
1717

1818
# test codec's full path name (see test/testcodec.py)
1919
codecname = 'test.testcodec'
20-
20+
2121
check(unicode('abc', codecname), u'abc')
2222
check(unicode('xdef', codecname), u'abcdef')
2323
check(unicode('defx', codecname), u'defabc')
@@ -41,4 +41,3 @@ def check(a, b):
4141
print '\\001 maps to undefined: OK'
4242
else:
4343
print '*** check failed: \\001 does not map to undefined'
44-

Lib/test/test_crypt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Roger E. Masse
44
"""
55

6-
from test_support import verify, verbose
6+
from test_support import verify, verbose
77
import crypt
88

99
c = crypt.crypt('mypassword', 'ab')

Lib/test/test_format.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,3 @@ def test_exc(formatstr, args, exception, excmsg):
198198
"unsupported format character 'a' (0x61) at index 5")
199199
test_exc(u'abc %\u3000', 1, ValueError,
200200
"unsupported format character '?' (0x3000) at index 5")
201-

Lib/test/test_sax.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def confirm(outcome, name):
3030
fails = fails + 1
3131

3232
def test_make_parser2():
33-
try:
33+
try:
3434
# Creating parsers several times in a row should succeed.
3535
# Testing this because there have been failures of this kind
3636
# before.
@@ -50,8 +50,8 @@ def test_make_parser2():
5050
return 0
5151
else:
5252
return p
53-
54-
53+
54+
5555
# ===========================================================================
5656
#
5757
# saxutils tests
@@ -397,7 +397,7 @@ def test_expat_locator_noinfo():
397397

398398
return parser.getSystemId() is None and \
399399
parser.getPublicId() is None and \
400-
parser.getLineNumber() == 1
400+
parser.getLineNumber() == 1
401401

402402
def test_expat_locator_withinfo():
403403
result = StringIO()

Lib/test/test_support.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ def findfile(file, here=__file__):
7373
return file
7474

7575
def verify(condition, reason='test failed'):
76-
77-
""" Verify that condition is true. If not, raise an
78-
AssertionError.
79-
80-
The optinal argument reason can be given to provide
81-
a better error text.
82-
83-
"""
84-
if not condition:
85-
raise AssertionError,reason
76+
77+
""" Verify that condition is true. If not, raise an
78+
AssertionError.
79+
80+
The optinal argument reason can be given to provide
81+
a better error text.
82+
83+
"""
84+
if not condition:
85+
raise AssertionError,reason

Lib/test/test_unicode.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def __getitem__(self, i): return self.seq[i]
195195

196196
# Non surrogate above surrogate value, fixup required
197197
def test_lecmp(s, s2):
198-
verify(s < s2 , "comparison failed on %s < %s" % (s, s2))
198+
verify(s < s2 , "comparison failed on %s < %s" % (s, s2))
199199

200200
def test_fixup(s):
201201
s2 = u'\ud800\udc01'
@@ -372,11 +372,11 @@ def test_fixup(s):
372372
verify(u'\ud84d\udc56'.encode('utf-8') == \
373373
''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))) )
374374
# UTF-8 specific decoding tests
375-
verify(unicode(''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))),
375+
verify(unicode(''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))),
376376
'utf-8') == u'\ud84d\udc56' )
377-
verify(unicode(''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))),
377+
verify(unicode(''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))),
378378
'utf-8') == u'\ud800\udc02' )
379-
verify(unicode(''.join((chr(0xe2), chr(0x82), chr(0xac))),
379+
verify(unicode(''.join((chr(0xe2), chr(0x82), chr(0xac))),
380380
'utf-8') == u'\u20ac' )
381381

382382
# Other possible utf-8 test cases:
@@ -501,15 +501,15 @@ def __str__(self):
501501
'cp852', 'cp855', 'cp860', 'cp861', 'cp862',
502502
'cp863', 'cp865', 'cp866',
503503
'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15',
504-
'iso8859_2', 'iso8859_4', 'iso8859_5',
504+
'iso8859_2', 'iso8859_4', 'iso8859_5',
505505
'iso8859_9', 'koi8_r', 'latin_1',
506506
'mac_cyrillic', 'mac_latin2',
507507

508508
### These have undefined mappings:
509509
#'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255',
510510
#'cp1256', 'cp1257', 'cp1258',
511511
#'cp424', 'cp856', 'cp857', 'cp864', 'cp869', 'cp874',
512-
#'iso8859_3', 'iso8859_6', 'iso8859_7',
512+
#'iso8859_3', 'iso8859_6', 'iso8859_7',
513513
#'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish',
514514

515515
### These fail the round-trip:

Lib/test/test_xreadline.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from test_support import verbose
22

33
class XReader:
4-
def __init__(self):
5-
self.count = 5
4+
def __init__(self):
5+
self.count = 5
66

7-
def readlines(self, sizehint = None):
8-
self.count = self.count - 1
9-
return map(lambda x: "%d\n" % x, range(self.count))
7+
def readlines(self, sizehint = None):
8+
self.count = self.count - 1
9+
return map(lambda x: "%d\n" % x, range(self.count))
1010

1111
class Null: pass
1212

@@ -16,28 +16,28 @@ class Null: pass
1616
lineno = 0
1717

1818
try:
19-
xreadlines.xreadlines(Null())[0]
19+
xreadlines.xreadlines(Null())[0]
2020
except AttributeError, detail:
21-
print "AttributeError (expected)"
21+
print "AttributeError (expected)"
2222
else:
23-
print "Did not throw attribute error"
23+
print "Did not throw attribute error"
2424

2525
try:
26-
xreadlines.xreadlines(XReader)[0]
26+
xreadlines.xreadlines(XReader)[0]
2727
except TypeError, detail:
28-
print "TypeError (expected)"
28+
print "TypeError (expected)"
2929
else:
30-
print "Did not throw type error"
30+
print "Did not throw type error"
3131

3232
try:
33-
xreadlines.xreadlines(XReader())[1]
33+
xreadlines.xreadlines(XReader())[1]
3434
except RuntimeError, detail:
35-
print "RuntimeError (expected):", detail
35+
print "RuntimeError (expected):", detail
3636
else:
37-
print "Did not throw runtime error"
37+
print "Did not throw runtime error"
3838

3939
xresult = ['0\n', '1\n', '2\n', '3\n', '0\n', '1\n', '2\n', '0\n', '1\n', '0\n']
4040
for line in xreadlines.xreadlines(XReader()):
41-
if line != xresult[lineno]:
42-
print "line %d differs" % lineno
43-
lineno += 1
41+
if line != xresult[lineno]:
42+
print "line %d differs" % lineno
43+
lineno += 1

Lib/test/testcodec.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ class Codec(codecs.Codec):
1414
def encode(self,input,errors='strict'):
1515

1616
return codecs.charmap_encode(input,errors,encoding_map)
17-
17+
1818
def decode(self,input,errors='strict'):
1919

2020
return codecs.charmap_decode(input,errors,decoding_map)
2121

2222
class StreamWriter(Codec,codecs.StreamWriter):
2323
pass
24-
24+
2525
class StreamReader(Codec,codecs.StreamReader):
2626
pass
2727

@@ -46,4 +46,3 @@ def getregentry():
4646
encoding_map = {}
4747
for k,v in decoding_map.items():
4848
encoding_map[v] = k
49-

0 commit comments

Comments
 (0)