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

Method test_abc_registry_kept

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

Source from the content-addressed store, hash-verified

4992 self.assertEqual(D[str].z, 'from derived z')
4993
4994 def test_abc_registry_kept(self):
4995 T = TypeVar('T')
4996 class C(collections.abc.Mapping, Generic[T]): ...
4997 C.register(int)
4998 self.assertIsInstance(1, C)
4999 C[int]
5000 self.assertIsInstance(1, C)
5001 C._abc_registry_clear()
5002 C._abc_caches_clear() # To keep refleak hunting mode clean
5003
5004 def test_false_subclasses(self):
5005 class MyMapping(MutableMapping[str, str]): pass

Callers

nothing calls this directly

Calls 4

assertIsInstanceMethod · 0.80
registerMethod · 0.45
_abc_registry_clearMethod · 0.45
_abc_caches_clearMethod · 0.45

Tested by

no test coverage detected