Included for symmetry with assertIsInstance.
(self, obj, cls, msg=None)
| 1337 | self.fail(self._formatMessage(msg, standardMsg)) |
| 1338 | |
| 1339 | def assertNotIsInstance(self, obj, cls, msg=None): |
| 1340 | """Included for symmetry with assertIsInstance.""" |
| 1341 | if isinstance(obj, cls): |
| 1342 | if isinstance(cls, tuple): |
| 1343 | for x in cls: |
| 1344 | if isinstance(obj, x): |
| 1345 | cls = x |
| 1346 | break |
| 1347 | standardMsg = f'{safe_repr(obj)} is an instance of {cls!r}' |
| 1348 | self.fail(self._formatMessage(msg, standardMsg)) |
| 1349 | |
| 1350 | def assertIsSubclass(self, cls, superclass, msg=None): |
| 1351 | try: |