| 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 | |
| 1537 | class FunctionTestCase(TestCase): |