def assertNotRegexpMatches(self, text, unexpected_regexp, msg=None):
if isinstance(unexpected_regexp, str):<EOL><INDENT>unexpected_regexp = re.compile(unexpected_regexp)<EOL><DEDENT>match = unexpected_regexp.search(text)<EOL>if match:<EOL><INDENT>msg = msg or "<STR_LIT>"<EOL>msg = '<STR_LIT>' % (msg,<EOL>text[match.start():match.end()],<EOL>unexpected_regexp.pattern,<EOL>text)<EOL>raise self.failureException(msg)<EOL><DEDENT>
Fail the test if the text matches the regular expression.