MCPcopy Index your code
hub / github.com/RustPython/RustPython / assertNotRegex

Method assertNotRegex

Lib/unittest/case.py:1452–1464  ·  view source on GitHub ↗

Fail the test if the text matches the regular expression.

(self, text, unexpected_regex, msg=None)

Source from the content-addressed store, hash-verified

1450 raise self.failureException(msg)
1451
1452 def assertNotRegex(self, text, unexpected_regex, msg=None):
1453 """Fail the test if the text matches the regular expression."""
1454 if isinstance(unexpected_regex, (str, bytes)):
1455 unexpected_regex = re.compile(unexpected_regex)
1456 match = unexpected_regex.search(text)
1457 if match:
1458 standardMsg = 'Regex matched: %r matches %r in %r' % (
1459 text[match.start() : match.end()],
1460 unexpected_regex.pattern,
1461 text)
1462 # _formatMessage ensures the longMessage option is respected
1463 msg = self._formatMessage(msg, standardMsg)
1464 raise self.failureException(msg)
1465
1466 def _tail_type_check(self, s, tails, msg):
1467 if not isinstance(tails, tuple):

Calls 6

_formatMessageMethod · 0.95
isinstanceFunction · 0.85
compileMethod · 0.45
searchMethod · 0.45
startMethod · 0.45
endMethod · 0.45