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

Method assertNotIsInstance

Lib/unittest/case.py:1344–1353  ·  view source on GitHub ↗

Included for symmetry with assertIsInstance.

(self, obj, cls, msg=None)

Source from the content-addressed store, hash-verified

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

Callers 15

test_not_hashableMethod · 0.80
test_hashMethod · 0.80
test_booleanMethod · 0.80
test_iter_keysMethod · 0.80
test_iter_valuesMethod · 0.80
test_iter_itemsMethod · 0.80
test_data_connectionMethod · 0.80

Calls 4

failMethod · 0.95
_formatMessageMethod · 0.95
isinstanceFunction · 0.85
safe_reprFunction · 0.85

Tested by 15

test_not_hashableMethod · 0.64
test_hashMethod · 0.64
test_booleanMethod · 0.64
test_iter_keysMethod · 0.64
test_iter_valuesMethod · 0.64
test_iter_itemsMethod · 0.64
test_data_connectionMethod · 0.64