summaryrefslogtreecommitdiffstats
path: root/Lib/unittest
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-05-08 16:46:14 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-05-08 16:46:14 (GMT)
commite3ef5f1201601190cd72fb3f952165a4bbdf2dc8 (patch)
tree09c3c7fb3693aa893a59bc0fe4f3bbb8c2c7e9b5 /Lib/unittest
parent3c451e6d9ea4edc603f01f6b9be78d7bb9596227 (diff)
downloadcpython-e3ef5f1201601190cd72fb3f952165a4bbdf2dc8.zip
cpython-e3ef5f1201601190cd72fb3f952165a4bbdf2dc8.tar.gz
cpython-e3ef5f1201601190cd72fb3f952165a4bbdf2dc8.tar.bz2
Merged revisions 80990 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r80990 | michael.foord | 2010-05-08 18:40:52 +0200 (Sat, 08 May 2010) | 1 line Updating documentation and adding docstrings to unittest.TestCase.assertRegexpMatches and assertNotRegexpMatches. Issue 8038. ........
Diffstat (limited to 'Lib/unittest')
-rw-r--r--Lib/unittest/case.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
index 366fe87..cbe8dcb 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -993,6 +993,7 @@ class TestCase(object):
callable_obj(*args, **kwargs)
def assertRegexpMatches(self, text, expected_regexp, msg=None):
+ """Fail the test unless the text matches the regular expression."""
if isinstance(expected_regexp, (str, bytes)):
expected_regexp = re.compile(expected_regexp)
if not expected_regexp.search(text):
@@ -1001,6 +1002,7 @@ class TestCase(object):
raise self.failureException(msg)
def assertNotRegexpMatches(self, text, unexpected_regexp, msg=None):
+ """Fail the test if the text matches the regular expression."""
if isinstance(unexpected_regexp, (str, bytes)):
unexpected_regexp = re.compile(unexpected_regexp)
match = unexpected_regexp.search(text)