]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43825: Fix deprecation warnings in test_cmd_line and test_collections (GH-25380)
authorKarthikeyan Singaravelan <tir.karthi@gmail.com>
Wed, 14 Apr 2021 11:45:22 +0000 (17:15 +0530)
committerGitHub <noreply@github.com>
Wed, 14 Apr 2021 11:45:22 +0000 (13:45 +0200)
* Fix deprecation warnings due to invalid escape sequences.
* Use self.assertEqual instead of deprecated self.assertEquals.

Lib/test/test_cmd_line.py
Lib/test/test_collections.py

index 375876768b29f5a0f4a8abbfc9a94ec257ba8744..cbf9ff2a863c3cea141fcd560745762b2814ec67 100644 (file)
@@ -862,7 +862,7 @@ class SyntaxErrorTests(unittest.TestCase):
         self.check_string(b"(1+2+3")
 
     def test_decoding_error_at_the_end_of_the_line(self):
-        self.check_string(b"'\u1f'")
+        self.check_string(br"'\u1f'")
 
 def test_main():
     support.run_unittest(CmdLineTest, IgnoreEnvironmentTest, SyntaxErrorTests)
index 7b245c08b5ddd3a97d4d319e085f62b9e3740790..98690d231e606b6734ccf1ac725280e95513a9e2 100644 (file)
@@ -1515,7 +1515,7 @@ class TestCollectionABCs(ABCTestCase):
         items = [5,43,2,1]
         s = MySet(items)
         r = s.pop()
-        self.assertEquals(len(s), len(items) - 1)
+        self.assertEqual(len(s), len(items) - 1)
         self.assertNotIn(r, s)
         self.assertIn(r, items)