diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-12-01 02:32:32 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-12-01 02:32:32 (GMT) |
| commit | ed3a7d2d601ce1e65b0bacf24676440631158ec8 (patch) | |
| tree | d8e7df73bc7d9aa2c3cfafd4adb9838dffcea230 /Lib/unittest/test/test_assertions.py | |
| parent | f10c400b91e44c5c744f4ddc05d90933cba3a56b (diff) | |
| download | cpython-ed3a7d2d601ce1e65b0bacf24676440631158ec8.zip cpython-ed3a7d2d601ce1e65b0bacf24676440631158ec8.tar.gz cpython-ed3a7d2d601ce1e65b0bacf24676440631158ec8.tar.bz2 | |
#10273: Rename assertRegexpMatches and assertRaisesRegexp to assertRegex and assertRaisesRegex.
Diffstat (limited to 'Lib/unittest/test/test_assertions.py')
| -rw-r--r-- | Lib/unittest/test/test_assertions.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/unittest/test/test_assertions.py b/Lib/unittest/test/test_assertions.py index 6a30db6..0ee7edb 100644 --- a/Lib/unittest/test/test_assertions.py +++ b/Lib/unittest/test/test_assertions.py @@ -92,15 +92,15 @@ class Test_Assertions(unittest.TestCase): else: self.fail("assertRaises() didn't let exception pass through") - def testAssertNotRegexpMatches(self): - self.assertNotRegexpMatches('Ala ma kota', r'r+') + def testAssertNotRegexMatches(self): + self.assertNotRegexMatches('Ala ma kota', r'r+') try: - self.assertNotRegexpMatches('Ala ma kota', r'k.t', 'Message') + self.assertNotRegexMatches('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('assertNotRegexpMatches should have failed.') + self.fail('assertNotRegexMatches should have failed.') class TestLongMessage(unittest.TestCase): @@ -153,15 +153,15 @@ class TestLongMessage(unittest.TestCase): test = self.testableTrue return getattr(test, methodName) - for i, expected_regexp in enumerate(errors): + for i, expected_regex in enumerate(errors): testMethod = getMethod(i) kwargs = {} withMsg = i % 2 if withMsg: kwargs = {"msg": "oops"} - with self.assertRaisesRegexp(self.failureException, - expected_regexp=expected_regexp): + with self.assertRaisesRegex(self.failureException, + expected_regex=expected_regex): testMethod(*args, **kwargs) def testAssertTrue(self): |
