unittest.TestCase.assertRegex()

assertRegex(text, regex, msg=None) assertNotRegex(text, regex, msg=None)

Test that a regex search matches (or does not match) text. In case of failure, the error message will include the pattern and the text (or the pattern and the part of text that unexpectedly matched). regex may be a regular expression object or a string containing a regular expression suitable for use by re.search().

New in version 3.1: under the name assertRegexpMatches.

Changed in version 3.2: The method assertRegexpMatches() has been renamed to assertRegex().

New in version 3.2: assertNotRegex().

doc_python
2016-10-07 17:46:23
Comments
Leave a Comment

Please login to continue.