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

Method validate_isinstance

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

Source from the content-addressed store, hash-verified

740 self.assertRaises(TypeError, C)
741
742 def validate_isinstance(self, abc, name):
743 stub = lambda s, *args: 0
744
745 C = type('C', (object,), {'__hash__': None})
746 setattr(C, name, stub)
747 self.assertIsInstance(C(), abc)
748 self.assertIsSubclass(C, abc)
749
750 C = type('C', (object,), {'__hash__': None})
751 self.assertNotIsInstance(C(), abc)
752 self.assertNotIsSubclass(C, abc)
753
754 def validate_comparison(self, instance):
755 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 5

assertIsInstanceMethod · 0.80
assertIsSubclassMethod · 0.80
assertNotIsInstanceMethod · 0.80
assertNotIsSubclassMethod · 0.80
CClass · 0.70

Tested by

no test coverage detected