bpo-43825: Fix deprecation warnings in test_cmd_line and test_collections (GH-25380)

* Fix deprecation warnings due to invalid escape sequences.
* Use self.assertEqual instead of deprecated self.assertEquals.
This commit is contained in:
Karthikeyan Singaravelan 2021-04-14 17:15:22 +05:30 committed by GitHub
parent 6f1e8ccffa
commit b8509ffa82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -862,7 +862,7 @@ class SyntaxErrorTests(unittest.TestCase):
self.check_string(b"(1+2+3") self.check_string(b"(1+2+3")
def test_decoding_error_at_the_end_of_the_line(self): def test_decoding_error_at_the_end_of_the_line(self):
self.check_string(b"'\u1f'") self.check_string(br"'\u1f'")
def test_main(): def test_main():
support.run_unittest(CmdLineTest, IgnoreEnvironmentTest, SyntaxErrorTests) support.run_unittest(CmdLineTest, IgnoreEnvironmentTest, SyntaxErrorTests)

View file

@ -1515,7 +1515,7 @@ class TestCollectionABCs(ABCTestCase):
items = [5,43,2,1] items = [5,43,2,1]
s = MySet(items) s = MySet(items)
r = s.pop() r = s.pop()
self.assertEquals(len(s), len(items) - 1) self.assertEqual(len(s), len(items) - 1)
self.assertNotIn(r, s) self.assertNotIn(r, s)
self.assertIn(r, items) self.assertIn(r, items)