#10273: Rename assertRegexpMatches and assertRaisesRegexp to assertRegex and assertRaisesRegex.
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 @@
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 @@
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):