[Python-checkins] r80990 - in python/trunk: Doc/library/unittest.rst Lib/unittest/case.py (original) (raw)
michael.foord python-checkins at python.org
Sat May 8 18:40:52 CEST 2010
- Previous message: [Python-checkins] r80989 - in python/branches/py3k: Lib/test/test_sysconfig.py
- Next message: [Python-checkins] r80991 - python/trunk/Lib/test/test_enumerate.py
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: michael.foord Date: Sat May 8 18:40:52 2010 New Revision: 80990
Log: Updating documentation and adding docstrings to unittest.TestCase.assertRegexpMatches and assertNotRegexpMatches. Issue 8038.
Modified: python/trunk/Doc/library/unittest.rst python/trunk/Lib/unittest/case.py
Modified: python/trunk/Doc/library/unittest.rst
--- python/trunk/Doc/library/unittest.rst (original) +++ python/trunk/Doc/library/unittest.rst Sat May 8 18:40:52 2010 @@ -907,9 +907,9 @@ .. method:: assertNotRegexpMatches(text, regexp, msg=None)
Verifies that a *regexp* search does not match *text*. Fails with an error
message including the pattern and the *text*. *regexp* may be
a regular expression object or a string containing a regular expression
suitable for use by :func:`re.search`.
message including the pattern and the part of *text* that matches. *regexp*
may be a regular expression object or a string containing a regular
expression suitable for use by :func:`re.search`. .. versionadded:: 2.7
Modified: python/trunk/Lib/unittest/case.py
--- python/trunk/Lib/unittest/case.py (original) +++ python/trunk/Lib/unittest/case.py Sat May 8 18:40:52 2010 @@ -945,6 +945,7 @@ 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, basestring): expected_regexp = re.compile(expected_regexp) if not expected_regexp.search(text):
@@ -953,6 +954,7 @@ 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, basestring): unexpected_regexp = re.compile(unexpected_regexp) match = unexpected_regexp.search(text)
- Previous message: [Python-checkins] r80989 - in python/branches/py3k: Lib/test/test_sysconfig.py
- Next message: [Python-checkins] r80991 - python/trunk/Lib/test/test_enumerate.py
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]