]> granicus.if.org Git - python/commitdiff
#10273: Remove a "Matches" that I missed in r86910. Thanks to RDM for noticing it.
authorEzio Melotti <ezio.melotti@gmail.com>
Fri, 10 Dec 2010 02:32:05 +0000 (02:32 +0000)
committerEzio Melotti <ezio.melotti@gmail.com>
Fri, 10 Dec 2010 02:32:05 +0000 (02:32 +0000)
Lib/unittest/case.py
Lib/unittest/test/test_assertions.py

index 227879cb6d4361d12b4d21624f68d62a85b4d5df..0ad78571b2582bd66af4b12bae478461113d063d 100644 (file)
@@ -1127,7 +1127,7 @@ class TestCase(object):
             msg = '%s: %r not found in %r' % (msg, expected_regex.pattern, text)
             raise self.failureException(msg)
 
-    def assertNotRegexMatches(self, text, unexpected_regex, msg=None):
+    def assertNotRegex(self, text, unexpected_regex, msg=None):
         """Fail the test if the text matches the regular expression."""
         if isinstance(unexpected_regex, (str, bytes)):
             unexpected_regex = re.compile(unexpected_regex)
index 69572eee19025584f9329af9677a4c6e4f776a2b..df2e89ead26383713b9bed868fcb0e1e99ecbd7a 100644 (file)
@@ -92,15 +92,15 @@ class Test_Assertions(unittest.TestCase):
         else:
             self.fail("assertRaises() didn't let exception pass through")
 
-    def testAssertNotRegexMatches(self):
-        self.assertNotRegexMatches('Ala ma kota', r'r+')
+    def testAssertNotRegex(self):
+        self.assertNotRegex('Ala ma kota', r'r+')
         try:
-            self.assertNotRegexMatches('Ala ma kota', r'k.t', 'Message')
+            self.assertNotRegex('Ala ma kota', r'k.t', 'Message')
         except self.failureException as e:
             self.assertIn("'kot'", e.args[0])
             self.assertIn('Message', e.args[0])
         else:
-            self.fail('assertNotRegexMatches should have failed.')
+            self.fail('assertNotRegex should have failed.')
 
 
 class TestLongMessage(unittest.TestCase):