Skip to content

Commit fcde2c6

Browse files
bpo-28395: Remove unnecessary semicolons in tests (GH-26868)
(cherry picked from commit 5a31080) Co-authored-by: Dong-hee Na <[email protected]>
1 parent ef89b2b commit fcde2c6

File tree

8 files changed

+32
-31
lines changed

8 files changed

+32
-31
lines changed

Lib/test/test_capi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,11 +553,11 @@ def callback():
553553
#unsuccessful.
554554
while True:
555555
if _testcapi._pending_threadfunc(callback):
556-
break;
556+
break
557557

558558
def pendingcalls_wait(self, l, n, context = None):
559559
#now, stick around until l[0] has grown to 10
560-
count = 0;
560+
count = 0
561561
while len(l) != n:
562562
#this busy loop is where we expect to be interrupted to
563563
#run our callbacks. Note that callbacks are only run on the

Lib/test/test_codeop.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -178,21 +178,21 @@ def test_incomplete(self):
178178
ai("from a import (b,c")
179179
ai("from a import (b,c,")
180180

181-
ai("[");
182-
ai("[a");
183-
ai("[a,");
184-
ai("[a,b");
185-
ai("[a,b,");
186-
187-
ai("{");
188-
ai("{a");
189-
ai("{a:");
190-
ai("{a:b");
191-
ai("{a:b,");
192-
ai("{a:b,c");
193-
ai("{a:b,c:");
194-
ai("{a:b,c:d");
195-
ai("{a:b,c:d,");
181+
ai("[")
182+
ai("[a")
183+
ai("[a,")
184+
ai("[a,b")
185+
ai("[a,b,")
186+
187+
ai("{")
188+
ai("{a")
189+
ai("{a:")
190+
ai("{a:b")
191+
ai("{a:b,")
192+
ai("{a:b,c")
193+
ai("{a:b,c:")
194+
ai("{a:b,c:d")
195+
ai("{a:b,c:d,")
196196

197197
ai("a(")
198198
ai("a(b")

Lib/test/test_csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def test_write_arg_valid(self):
156156
self._write_error_test(OSError, BadIterable())
157157
class BadList:
158158
def __len__(self):
159-
return 10;
159+
return 10
160160
def __getitem__(self, i):
161161
if i > 2:
162162
raise OSError

Lib/test/test_deque.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ def __eq__(self, other):
148148
self.assertEqual(d.count(None), 16)
149149

150150
def test_comparisons(self):
151-
d = deque('xabc'); d.popleft()
151+
d = deque('xabc')
152+
d.popleft()
152153
for e in [d, deque('abc'), deque('ab'), deque(), list(d)]:
153154
self.assertEqual(d==e, type(d)==type(e) and list(d)==list(e))
154155
self.assertEqual(d!=e, not(type(d)==type(e) and list(d)==list(e)))
@@ -562,8 +563,8 @@ def test_print(self):
562563
support.unlink(support.TESTFN)
563564

564565
def test_init(self):
565-
self.assertRaises(TypeError, deque, 'abc', 2, 3);
566-
self.assertRaises(TypeError, deque, 1);
566+
self.assertRaises(TypeError, deque, 'abc', 2, 3)
567+
self.assertRaises(TypeError, deque, 1)
567568

568569
def test_hash(self):
569570
self.assertRaises(TypeError, hash, deque('abc'))

Lib/test/test_float.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,10 +1162,10 @@ def test_whitespace(self):
11621162

11631163

11641164
def test_from_hex(self):
1165-
MIN = self.MIN;
1166-
MAX = self.MAX;
1167-
TINY = self.TINY;
1168-
EPS = self.EPS;
1165+
MIN = self.MIN
1166+
MAX = self.MAX
1167+
TINY = self.TINY
1168+
EPS = self.EPS
11691169

11701170
# two spellings of infinity, with optional signs; case-insensitive
11711171
self.identical(fromHex('inf'), INF)

Lib/test/test_heapq.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ def test_heappushpop(self):
145145
self.assertEqual(type(h[0]), int)
146146
self.assertEqual(type(x), float)
147147

148-
h = [10];
148+
h = [10]
149149
x = self.module.heappushpop(h, 9)
150150
self.assertEqual((h, x), ([10], 9))
151151

152-
h = [10];
152+
h = [10]
153153
x = self.module.heappushpop(h, 11)
154154
self.assertEqual((h, x), ([11], 10))
155155

Lib/test/test_import/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ def test_get_sourcefile(self):
10841084
# Given a valid bytecode path, return the path to the corresponding
10851085
# source file if it exists.
10861086
with mock.patch('importlib._bootstrap_external._path_isfile') as _path_isfile:
1087-
_path_isfile.return_value = True;
1087+
_path_isfile.return_value = True
10881088
path = TESTFN + '.pyc'
10891089
expect = TESTFN + '.py'
10901090
self.assertEqual(_get_sourcefile(path), expect)
@@ -1093,7 +1093,7 @@ def test_get_sourcefile_no_source(self):
10931093
# Given a valid bytecode path without a corresponding source path,
10941094
# return the original bytecode path.
10951095
with mock.patch('importlib._bootstrap_external._path_isfile') as _path_isfile:
1096-
_path_isfile.return_value = False;
1096+
_path_isfile.return_value = False
10971097
path = TESTFN + '.pyc'
10981098
self.assertEqual(_get_sourcefile(path), path)
10991099

Lib/test/test_set.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ def test_init(self):
375375
self.assertEqual(s, set(self.word))
376376
s.__init__(self.otherword)
377377
self.assertEqual(s, set(self.otherword))
378-
self.assertRaises(TypeError, s.__init__, s, 2);
379-
self.assertRaises(TypeError, s.__init__, 1);
378+
self.assertRaises(TypeError, s.__init__, s, 2)
379+
self.assertRaises(TypeError, s.__init__, 1)
380380

381381
def test_constructor_identity(self):
382382
s = self.thetype(range(3))

0 commit comments

Comments
 (0)