[Python-checkins] cpython: lib2to3 tests: Don't use deprecated API, switch to assertRegex()

victor.stinner python-checkins at python.org
Mon Feb 13 23:35:53 CET 2012


http://hg.python.org/cpython/rev/76dfd1f08025
changeset:   74917:76dfd1f08025
parent:      74914:80a50b7ad88f
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Mon Feb 13 23:31:26 2012 +0100
summary:
  lib2to3 tests: Don't use deprecated API, switch to assertRegex()

files:
  Lib/lib2to3/tests/test_main.py     |  2 +-
  Lib/lib2to3/tests/test_refactor.py |  2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Lib/lib2to3/tests/test_main.py b/Lib/lib2to3/tests/test_main.py
--- a/Lib/lib2to3/tests/test_main.py
+++ b/Lib/lib2to3/tests/test_main.py
@@ -94,7 +94,7 @@
             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):
diff --git a/Lib/lib2to3/tests/test_refactor.py b/Lib/lib2to3/tests/test_refactor.py
--- a/Lib/lib2to3/tests/test_refactor.py
+++ b/Lib/lib2to3/tests/test_refactor.py
@@ -230,7 +230,7 @@
                 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))

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list