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

Method validate_isinstance

Lib/test/test_collections.py:741–751  ·  view source on GitHub ↗
(self, abc, name)

Source from the content-addressed store, hash-verified

739 self.assertRaises(TypeError, C)
740
741 def validate_isinstance(self, abc, name):
742 stub = lambda s, *args: 0
743
744 C = type('C', (object,), {'__hash__': None})
745 setattr(C, name, stub)
746 self.assertIsInstance(C(), abc)
747 self.assertIsSubclass(C, abc)
748
749 C = type('C', (object,), {'__hash__': None})
750 self.assertNotIsInstance(C(), abc)
751 self.assertNotIsSubclass(C, abc)
752
753 def validate_comparison(self, instance):
754 ops = ['lt', 'gt', 'le', 'ge', 'ne', 'or', 'and', 'xor', 'sub']

Callers 6

test_HashableMethod · 0.80
test_AsyncIterableMethod · 0.80
test_IterableMethod · 0.80
test_SizedMethod · 0.80
test_ContainerMethod · 0.80
test_CallableMethod · 0.80

Calls 6

setattrFunction · 0.85
assertIsInstanceMethod · 0.80
assertNotIsInstanceMethod · 0.80
CClass · 0.70
assertIsSubclassMethod · 0.45
assertNotIsSubclassMethod · 0.45

Tested by

no test coverage detected