MCPcopy Index your code
hub / github.com/python/cpython / assertNotStartsWith

Method assertNotStartsWith

Lib/unittest/case.py:1489–1503  ·  view source on GitHub ↗
(self, s, prefix, msg=None)

Source from the content-addressed store, hash-verified

1487 self.fail(self._formatMessage(msg, standardMsg))
1488
1489 def assertNotStartsWith(self, s, prefix, msg=None):
1490 try:
1491 if not s.startswith(prefix):
1492 return
1493 except (AttributeError, TypeError):
1494 self._tail_type_check(s, prefix, msg)
1495 raise
1496 if isinstance(prefix, tuple):
1497 for x in prefix:
1498 if s.startswith(x):
1499 prefix = x
1500 break
1501 a = safe_repr(s, short=True)
1502 b = safe_repr(prefix)
1503 self.fail(self._formatMessage(msg, f"{a} starts with {b}"))
1504
1505 def assertEndsWith(self, s, suffix, msg=None):
1506 try:

Calls 5

_tail_type_checkMethod · 0.95
failMethod · 0.95
_formatMessageMethod · 0.95
safe_reprFunction · 0.85
startswithMethod · 0.45