mirror of
https://github.com/python/cpython.git
synced 2024-12-25 01:34:48 +08:00
lib2to3 tests: Don't use deprecated API, switch to assertRegex()
This commit is contained in:
parent
5e4d908704
commit
3634bfbee6
@ -94,7 +94,7 @@ class TestMain(unittest.TestCase):
|
||||
self.assertIn("Writing converted %s to %s" % (
|
||||
os.path.join(self.py2_src_dir, name),
|
||||
os.path.join(self.py3_dest_dir, name+suffix)), stderr)
|
||||
self.assertRegexpMatches(stderr, r"No changes to .*/__init__\.py")
|
||||
self.assertRegex(stderr, r"No changes to .*/__init__\.py")
|
||||
self.assertNotRegex(stderr, r"No changes to .*/trivial\.py")
|
||||
|
||||
def test_filename_changing_on_output_two_files(self):
|
||||
|
@ -230,7 +230,7 @@ from __future__ import print_function"""
|
||||
os.sep, os.path.basename(test_file))
|
||||
for message in debug_messages:
|
||||
if "Not writing changes" in message:
|
||||
self.assertRegexpMatches(message, message_regex)
|
||||
self.assertRegex(message, message_regex)
|
||||
break
|
||||
else:
|
||||
self.fail("%r not matched in %r" % (message_regex, debug_messages))
|
||||
|
Loading…
Reference in New Issue
Block a user