]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-28395: Remove unnecessary semicolons in tests (GH-26868)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 23 Jun 2021 10:03:00 +0000 (03:03 -0700)
committerGitHub <noreply@github.com>
Wed, 23 Jun 2021 10:03:00 +0000 (03:03 -0700)
(cherry picked from commit 5a3108044d2e5b694da2d1f4176c9bbaef15c142)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
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 5150d5770f6644cbd16a1b1305cbf978c422a0be..b21c3acf39b245e79c42f59adc69ec2a68f31414 100644 (file)
@@ -553,11 +553,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 66caf5aaae32b978beaf4f820bc648406bfc8786..98f4be291b73b9caaadae6e7aa2c68445cf7916e 100644 (file)
@@ -178,21 +178,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 d421be075ca27fb01fa31cc83a784f4bf5e10631..2dab17dc073b1b9e2021e8f09142f2b075a88171 100644 (file)
@@ -156,7 +156,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 c0f7138254f3f6f493314fd1fcbccc80a0c74a64..67c0ace3bc8689f74b8a02559912ca1dbd7ae9a4 100644 (file)
@@ -148,7 +148,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)))
@@ -562,8 +563,8 @@ class TestBasic(unittest.TestCase):
             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'))
index 9651281e24edbe7a6dd6d0f6cffc4b04c5f36a7e..4f66b41e0ad0ecad615eb9d0a653b68a4478b93a 100644 (file)
@@ -1162,10 +1162,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 6902573e8fa85a7e68bc7a302ec074eaf516f628..2cca9a008baa5080232037fb8a6d940cfb418400 100644 (file)
@@ -145,11 +145,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 35f148436df3974ee80804e328c7aa03903c156f..538b22d3ff9723d9b446e40e69ee970a9186ef44 100644 (file)
@@ -1084,7 +1084,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)
@@ -1093,7 +1093,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 e4766ab190be011f821faa73558abe1067d8948d..faf25a79e80212c280142cbff2e7bcc227bd29f3 100644 (file)
@@ -375,8 +375,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))