[Python-checkins] bpo-28395: Remove unnecessary semicolons in tests (GH-26868)

miss-islington webhook-mailer at python.org
Wed Jun 23 06:02:45 EDT 2021


https://github.com/python/cpython/commit/280425d41797f9c0b20fb02a22341937a13a8987
commit: 280425d41797f9c0b20fb02a22341937a13a8987
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2021-06-23T03:02:40-07:00
summary:

bpo-28395: Remove unnecessary semicolons in tests (GH-26868)

(cherry picked from commit 5a3108044d2e5b694da2d1f4176c9bbaef15c142)

Co-authored-by: Dong-hee Na <donghee.na at python.org>

files:
M Lib/test/test_capi.py
M Lib/test/test_codeop.py
M Lib/test/test_csv.py
M Lib/test/test_deque.py
M Lib/test/test_float.py
M Lib/test/test_heapq.py
M Lib/test/test_import/__init__.py
M Lib/test/test_set.py

diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index 1b18bfad553007..f9c5aca728b433 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -635,11 +635,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
diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py
index 07b46afbe1bd89..17376c7ed7537e 100644
--- a/Lib/test/test_codeop.py
+++ b/Lib/test/test_codeop.py
@@ -182,21 +182,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("{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")
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py
index a1e050acd2a0c6..225f5c7289081a 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -157,7 +157,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
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py
index 93cc6ca4f44ecb..8bd6ebdbbadb5d 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -129,7 +129,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)))
@@ -529,8 +530,8 @@ def test_repr(self):
         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'))
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index f0ed40f7c94a7e..38a17cedd6446f 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -1184,10 +1184,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)
diff --git a/Lib/test/test_heapq.py b/Lib/test/test_heapq.py
index ebbc62745707cc..cb1e4505b02a30 100644
--- a/Lib/test/test_heapq.py
+++ b/Lib/test/test_heapq.py
@@ -146,11 +146,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))
 
diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py
index 8fe3e1d4bf38d8..97447619b90d2d 100644
--- a/Lib/test/test_import/__init__.py
+++ b/Lib/test/test_import/__init__.py
@@ -1086,7 +1086,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)
@@ -1095,7 +1095,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)
 
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index e45f018d2da71b..b1fab0f6207f40 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -362,8 +362,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))



More information about the Python-checkins mailing list