Skip to content

Commit 5a31080

Browse files
authored
bpo-28395: Remove unnecessary semicolons in tests (GH-26868)
1 parent c3f52b4 commit 5a31080

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
@@ -635,11 +635,11 @@ def callback():
635635
#unsuccessful.
636636
while True:
637637
if _testcapi._pending_threadfunc(callback):
638-
break;
638+
break
639639

640640
def pendingcalls_wait(self, l, n, context = None):
641641
#now, stick around until l[0] has grown to 10
642-
count = 0;
642+
count = 0
643643
while len(l) != n:
644644
#this busy loop is where we expect to be interrupted to
645645
#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
@@ -182,21 +182,21 @@ def test_incomplete(self):
182182
ai("from a import (b,c")
183183
ai("from a import (b,c,")
184184

185-
ai("[");
186-
ai("[a");
187-
ai("[a,");
188-
ai("[a,b");
189-
ai("[a,b,");
190-
191-
ai("{");
192-
ai("{a");
193-
ai("{a:");
194-
ai("{a:b");
195-
ai("{a:b,");
196-
ai("{a:b,c");
197-
ai("{a:b,c:");
198-
ai("{a:b,c:d");
199-
ai("{a:b,c:d,");
185+
ai("[")
186+
ai("[a")
187+
ai("[a,")
188+
ai("[a,b")
189+
ai("[a,b,")
190+
191+
ai("{")
192+
ai("{a")
193+
ai("{a:")
194+
ai("{a:b")
195+
ai("{a:b,")
196+
ai("{a:b,c")
197+
ai("{a:b,c:")
198+
ai("{a:b,c:d")
199+
ai("{a:b,c:d,")
200200

201201
ai("a(")
202202
ai("a(b")

Lib/test/test_csv.py

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

Lib/test/test_deque.py

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

131131
def test_comparisons(self):
132-
d = deque('xabc'); d.popleft()
132+
d = deque('xabc')
133+
d.popleft()
133134
for e in [d, deque('abc'), deque('ab'), deque(), list(d)]:
134135
self.assertEqual(d==e, type(d)==type(e) and list(d)==list(e))
135136
self.assertEqual(d!=e, not(type(d)==type(e) and list(d)==list(e)))
@@ -529,8 +530,8 @@ def test_repr(self):
529530
self.assertEqual(repr(d)[-20:], '7, 198, 199, [...]])')
530531

531532
def test_init(self):
532-
self.assertRaises(TypeError, deque, 'abc', 2, 3);
533-
self.assertRaises(TypeError, deque, 1);
533+
self.assertRaises(TypeError, deque, 'abc', 2, 3)
534+
self.assertRaises(TypeError, deque, 1)
534535

535536
def test_hash(self):
536537
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
@@ -1184,10 +1184,10 @@ def test_whitespace(self):
11841184

11851185

11861186
def test_from_hex(self):
1187-
MIN = self.MIN;
1188-
MAX = self.MAX;
1189-
TINY = self.TINY;
1190-
EPS = self.EPS;
1187+
MIN = self.MIN
1188+
MAX = self.MAX
1189+
TINY = self.TINY
1190+
EPS = self.EPS
11911191

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

Lib/test/test_heapq.py

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

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

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

Lib/test/test_import/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ def test_get_sourcefile(self):
10861086
# Given a valid bytecode path, return the path to the corresponding
10871087
# source file if it exists.
10881088
with mock.patch('importlib._bootstrap_external._path_isfile') as _path_isfile:
1089-
_path_isfile.return_value = True;
1089+
_path_isfile.return_value = True
10901090
path = TESTFN + '.pyc'
10911091
expect = TESTFN + '.py'
10921092
self.assertEqual(_get_sourcefile(path), expect)
@@ -1095,7 +1095,7 @@ def test_get_sourcefile_no_source(self):
10951095
# Given a valid bytecode path without a corresponding source path,
10961096
# return the original bytecode path.
10971097
with mock.patch('importlib._bootstrap_external._path_isfile') as _path_isfile:
1098-
_path_isfile.return_value = False;
1098+
_path_isfile.return_value = False
10991099
path = TESTFN + '.pyc'
11001100
self.assertEqual(_get_sourcefile(path), path)
11011101

Lib/test/test_set.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ def test_init(self):
362362
self.assertEqual(s, set(self.word))
363363
s.__init__(self.otherword)
364364
self.assertEqual(s, set(self.otherword))
365-
self.assertRaises(TypeError, s.__init__, s, 2);
366-
self.assertRaises(TypeError, s.__init__, 1);
365+
self.assertRaises(TypeError, s.__init__, s, 2)
366+
self.assertRaises(TypeError, s.__init__, 1)
367367

368368
def test_constructor_identity(self):
369369
s = self.thetype(range(3))

0 commit comments

Comments
 (0)