]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-28395: Remove unnecessary semicolons in tests (GH-26868)
authorDong-hee Na <donghee.na@python.org>
Wed, 23 Jun 2021 09:01:06 +0000 (18:01 +0900)
committerGitHub <noreply@github.com>
Wed, 23 Jun 2021 09:01:06 +0000 (18:01 +0900)
Lib/test/test_capi.py
Lib/test/test_codeop.py
Lib/test/test_csv.py
Lib/test/test_deque.py
Lib/test/test_float.py
Lib/test/test_heapq.py
Lib/test/test_import/__init__.py
Lib/test/test_set.py

index f4b7b8c13b7d3809f0f3c7ce7eb2fa2f0aa39d1b..169e7acbf92b4ca78b71ca0eb3a18573557bb4a9 100644 (file)
@@ -635,11 +635,11 @@ class TestPendingCalls(unittest.TestCase):
             #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
index 07b46afbe1bd89270d6d2ff656186210a6d77144..17376c7ed7537eb91e81d9d37c2a9bde22f33e44 100644 (file)
@@ -182,21 +182,21 @@ class CodeopTests(unittest.TestCase):
         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("{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("{")
+        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")
index a1e050acd2a0c6ddc41e956ae0dea2f19485dd5c..225f5c7289081a043006f71df1b3318f8997f5ad 100644 (file)
@@ -157,7 +157,7 @@ class Test_Csv(unittest.TestCase):
         self._write_error_test(OSError, BadIterable())
         class BadList:
             def __len__(self):
-                return 10;
+                return 10
             def __getitem__(self, i):
                 if i > 2:
                     raise OSError
index f1a79373decda5dc9d20c236bd22d5cfb94919ad..ffe0e204a0e8c0fb8ddcf63dd1f5ff44ad44d272 100644 (file)
@@ -129,7 +129,8 @@ class TestBasic(unittest.TestCase):
         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)))
@@ -529,8 +530,8 @@ class TestBasic(unittest.TestCase):
         self.assertEqual(repr(d)[-20:], '7, 198, 199, [...]])')
 
     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'))
index f0ed40f7c94a7ec0f6e20c0a2cfaca36388d4738..38a17cedd6446f87b2223001a5710bd2ad9759e3 100644 (file)
@@ -1184,10 +1184,10 @@ class HexFloatTestCase(unittest.TestCase):
 
 
     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)
index ebbc62745707cc407067061f2fb471973150f9e7..cb1e4505b02a3011fef928f876d9e93fbaba56d8 100644 (file)
@@ -146,11 +146,11 @@ class TestHeap:
         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))
 
index 8fe3e1d4bf38d8f971919492dd8b5dedaa362c3d..97447619b90d2db14fa53fad7cfa6a6da9bd18ee 100644 (file)
@@ -1086,7 +1086,7 @@ class GetSourcefileTests(unittest.TestCase):
         # 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)
@@ -1095,7 +1095,7 @@ class GetSourcefileTests(unittest.TestCase):
         # 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)
 
index e45f018d2da71b58cfa6bbaadc521a51d84194ca..b1fab0f6207f40d9746cac90cc0a67b60c6c7d54 100644 (file)
@@ -362,8 +362,8 @@ class TestSet(TestJointOps, unittest.TestCase):
         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))