Skip to content

Commit b8509ff

Browse files
authored
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.
1 parent 6f1e8cc commit b8509ff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/test/test_cmd_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ def test_tokenizer_error_with_stdin(self):
862862
self.check_string(b"(1+2+3")
863863

864864
def test_decoding_error_at_the_end_of_the_line(self):
865-
self.check_string(b"'\u1f'")
865+
self.check_string(br"'\u1f'")
866866

867867
def test_main():
868868
support.run_unittest(CmdLineTest, IgnoreEnvironmentTest, SyntaxErrorTests)

Lib/test/test_collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ def __repr__(self):
15151515
items = [5,43,2,1]
15161516
s = MySet(items)
15171517
r = s.pop()
1518-
self.assertEquals(len(s), len(items) - 1)
1518+
self.assertEqual(len(s), len(items) - 1)
15191519
self.assertNotIn(r, s)
15201520
self.assertIn(r, items)
15211521

0 commit comments

Comments
 (0)