mirror of https://github.com/python/cpython.git
bpo-28395: Remove unnecessary semicolons in tests (GH-26868)
(cherry picked from commit 5a3108044d
)
Co-authored-by: Dong-hee Na <donghee.na@python.org>
This commit is contained in:
parent
ef89b2bf42
commit
fcde2c6a8c
|
@ -553,11 +553,11 @@ def callback():
|
|||
#unsuccessful.
|
||||
while True:
|
||||
if _testcapi._pending_threadfunc(callback):
|
||||
break;
|
||||
break
|
||||
|
||||
def pendingcalls_wait(self, l, n, context = None):
|
||||
#now, stick around until l[0] has grown to 10
|
||||
count = 0;
|
||||
count = 0
|
||||
while len(l) != n:
|
||||
#this busy loop is where we expect to be interrupted to
|
||||
#run our callbacks. Note that callbacks are only run on the
|
||||
|
|
|
@ -178,21 +178,21 @@ def test_incomplete(self):
|
|||
ai("from a import (b,c")
|
||||
ai("from a import (b,c,")
|
||||
|
||||
ai("[");
|
||||
ai("[a");
|
||||
ai("[a,");
|
||||
ai("[a,b");
|
||||
ai("[a,b,");
|
||||
ai("[")
|
||||
ai("[a")
|
||||
ai("[a,")
|
||||
ai("[a,b")
|
||||
ai("[a,b,")
|
||||
|
||||
ai("{");
|
||||
ai("{a");
|
||||
ai("{a:");
|
||||
ai("{a:b");
|
||||
ai("{a:b,");
|
||||
ai("{a:b,c");
|
||||
ai("{a:b,c:");
|
||||
ai("{a:b,c:d");
|
||||
ai("{a:b,c:d,");
|
||||
ai("{")
|
||||
ai("{a")
|
||||
ai("{a:")
|
||||
ai("{a:b")
|
||||
ai("{a:b,")
|
||||
ai("{a:b,c")
|
||||
ai("{a:b,c:")
|
||||
ai("{a:b,c:d")
|
||||
ai("{a:b,c:d,")
|
||||
|
||||
ai("a(")
|
||||
ai("a(b")
|
||||
|
|
|
@ -156,7 +156,7 @@ def test_write_arg_valid(self):
|
|||
self._write_error_test(OSError, BadIterable())
|
||||
class BadList:
|
||||
def __len__(self):
|
||||
return 10;
|
||||
return 10
|
||||
def __getitem__(self, i):
|
||||
if i > 2:
|
||||
raise OSError
|
||||
|
|
|
@ -148,7 +148,8 @@ def __eq__(self, other):
|
|||
self.assertEqual(d.count(None), 16)
|
||||
|
||||
def test_comparisons(self):
|
||||
d = deque('xabc'); d.popleft()
|
||||
d = deque('xabc')
|
||||
d.popleft()
|
||||
for e in [d, deque('abc'), deque('ab'), deque(), list(d)]:
|
||||
self.assertEqual(d==e, type(d)==type(e) and list(d)==list(e))
|
||||
self.assertEqual(d!=e, not(type(d)==type(e) and list(d)==list(e)))
|
||||
|
@ -562,8 +563,8 @@ def test_print(self):
|
|||
support.unlink(support.TESTFN)
|
||||
|
||||
def test_init(self):
|
||||
self.assertRaises(TypeError, deque, 'abc', 2, 3);
|
||||
self.assertRaises(TypeError, deque, 1);
|
||||
self.assertRaises(TypeError, deque, 'abc', 2, 3)
|
||||
self.assertRaises(TypeError, deque, 1)
|
||||
|
||||
def test_hash(self):
|
||||
self.assertRaises(TypeError, hash, deque('abc'))
|
||||
|
|
|
@ -1162,10 +1162,10 @@ def test_whitespace(self):
|
|||
|
||||
|
||||
def test_from_hex(self):
|
||||
MIN = self.MIN;
|
||||
MAX = self.MAX;
|
||||
TINY = self.TINY;
|
||||
EPS = self.EPS;
|
||||
MIN = self.MIN
|
||||
MAX = self.MAX
|
||||
TINY = self.TINY
|
||||
EPS = self.EPS
|
||||
|
||||
# two spellings of infinity, with optional signs; case-insensitive
|
||||
self.identical(fromHex('inf'), INF)
|
||||
|
|
|
@ -145,11 +145,11 @@ def test_heappushpop(self):
|
|||
self.assertEqual(type(h[0]), int)
|
||||
self.assertEqual(type(x), float)
|
||||
|
||||
h = [10];
|
||||
h = [10]
|
||||
x = self.module.heappushpop(h, 9)
|
||||
self.assertEqual((h, x), ([10], 9))
|
||||
|
||||
h = [10];
|
||||
h = [10]
|
||||
x = self.module.heappushpop(h, 11)
|
||||
self.assertEqual((h, x), ([11], 10))
|
||||
|
||||
|
|
|
@ -1084,7 +1084,7 @@ def test_get_sourcefile(self):
|
|||
# Given a valid bytecode path, return the path to the corresponding
|
||||
# source file if it exists.
|
||||
with mock.patch('importlib._bootstrap_external._path_isfile') as _path_isfile:
|
||||
_path_isfile.return_value = True;
|
||||
_path_isfile.return_value = True
|
||||
path = TESTFN + '.pyc'
|
||||
expect = TESTFN + '.py'
|
||||
self.assertEqual(_get_sourcefile(path), expect)
|
||||
|
@ -1093,7 +1093,7 @@ def test_get_sourcefile_no_source(self):
|
|||
# Given a valid bytecode path without a corresponding source path,
|
||||
# return the original bytecode path.
|
||||
with mock.patch('importlib._bootstrap_external._path_isfile') as _path_isfile:
|
||||
_path_isfile.return_value = False;
|
||||
_path_isfile.return_value = False
|
||||
path = TESTFN + '.pyc'
|
||||
self.assertEqual(_get_sourcefile(path), path)
|
||||
|
||||
|
|
|
@ -375,8 +375,8 @@ def test_init(self):
|
|||
self.assertEqual(s, set(self.word))
|
||||
s.__init__(self.otherword)
|
||||
self.assertEqual(s, set(self.otherword))
|
||||
self.assertRaises(TypeError, s.__init__, s, 2);
|
||||
self.assertRaises(TypeError, s.__init__, 1);
|
||||
self.assertRaises(TypeError, s.__init__, s, 2)
|
||||
self.assertRaises(TypeError, s.__init__, 1)
|
||||
|
||||
def test_constructor_identity(self):
|
||||
s = self.thetype(range(3))
|
||||
|
|
Loading…
Reference in New Issue