[Python-checkins] r87152 - in python/branches/py3k/Lib/unittest: case.py test/test_assertions.py
ezio.melotti
python-checkins at python.org
Fri Dec 10 03:32:06 CET 2010
Author: ezio.melotti
Date: Fri Dec 10 03:32:05 2010
New Revision: 87152
Log:
#10273: Remove a "Matches" that I missed in r86910. Thanks to RDM for noticing it.
Modified:
python/branches/py3k/Lib/unittest/case.py
python/branches/py3k/Lib/unittest/test/test_assertions.py
Modified: python/branches/py3k/Lib/unittest/case.py
==============================================================================
--- python/branches/py3k/Lib/unittest/case.py (original)
+++ python/branches/py3k/Lib/unittest/case.py Fri Dec 10 03:32:05 2010
@@ -1127,7 +1127,7 @@
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)
Modified: python/branches/py3k/Lib/unittest/test/test_assertions.py
==============================================================================
--- python/branches/py3k/Lib/unittest/test/test_assertions.py (original)
+++ python/branches/py3k/Lib/unittest/test/test_assertions.py Fri Dec 10 03:32:05 2010
@@ -92,15 +92,15 @@
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):
More information about the Python-checkins
mailing list