Commit 0db535a3 authored by Victor Stinner's avatar Victor Stinner

lib2to3 tests: Don't use deprecated API, switch to assertRegex()

parent 2c13e8e0
...@@ -94,7 +94,7 @@ class TestMain(unittest.TestCase): ...@@ -94,7 +94,7 @@ class TestMain(unittest.TestCase):
self.assertIn("Writing converted %s to %s" % ( self.assertIn("Writing converted %s to %s" % (
os.path.join(self.py2_src_dir, name), os.path.join(self.py2_src_dir, name),
os.path.join(self.py3_dest_dir, name+suffix)), stderr) 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") self.assertNotRegex(stderr, r"No changes to .*/trivial\.py")
def test_filename_changing_on_output_two_files(self): def test_filename_changing_on_output_two_files(self):
......
...@@ -230,7 +230,7 @@ from __future__ import print_function""" ...@@ -230,7 +230,7 @@ from __future__ import print_function"""
os.sep, os.path.basename(test_file)) os.sep, os.path.basename(test_file))
for message in debug_messages: for message in debug_messages:
if "Not writing changes" in message: if "Not writing changes" in message:
self.assertRegexpMatches(message, message_regex) self.assertRegex(message, message_regex)
break break
else: else:
self.fail("%r not matched in %r" % (message_regex, debug_messages)) self.fail("%r not matched in %r" % (message_regex, debug_messages))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment