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

Method assertNotEndsWith

Lib/unittest/case.py:1520–1534  ·  view source on GitHub ↗
(self, s, suffix, msg=None)

Source from the content-addressed store, hash-verified

1518 self.fail(self._formatMessage(msg, standardMsg))
1519
1520 def assertNotEndsWith(self, s, suffix, msg=None):
1521 try:
1522 if not s.endswith(suffix):
1523 return
1524 except (AttributeError, TypeError):
1525 self._tail_type_check(s, suffix, msg)
1526 raise
1527 if isinstance(suffix, tuple):
1528 for x in suffix:
1529 if s.endswith(x):
1530 suffix = x
1531 break
1532 a = safe_repr(s, short=True)
1533 b = safe_repr(suffix)
1534 self.fail(self._formatMessage(msg, f"{a} ends with {b}"))
1535
1536
1537class FunctionTestCase(TestCase):

Calls 5

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