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

Method test_abc_registry_kept

Lib/test/test_typing.py:4887–4895  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4885 self.assertEqual(D[str].z, 'from derived z')
4886
4887 def test_abc_registry_kept(self):
4888 T = TypeVar('T')
4889 class C(collections.abc.Mapping, Generic[T]): ...
4890 C.register(int)
4891 self.assertIsInstance(1, C)
4892 C[int]
4893 self.assertIsInstance(1, C)
4894 C._abc_registry_clear()
4895 C._abc_caches_clear() # To keep refleak hunting mode clean
4896
4897 def test_false_subclasses(self):
4898 class MyMapping(MutableMapping[str, str]): pass

Callers

nothing calls this directly

Calls 5

TypeVarClass · 0.85
assertIsInstanceMethod · 0.80
registerMethod · 0.45
_abc_registry_clearMethod · 0.45
_abc_caches_clearMethod · 0.45

Tested by

no test coverage detected