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

Method test_isinstance_invalidation

Lib/test/test_abc.py:318–331  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

316 self.assertIs(C, A.register(C))
317
318 def test_isinstance_invalidation(self):
319 class A(metaclass=abc_ABCMeta):
320 pass
321 class B:
322 pass
323 b = B()
324 self.assertNotIsInstance(b, A)
325 self.assertNotIsInstance(b, (A,))
326 token_old = abc_get_cache_token()
327 A.register(B)
328 token_new = abc_get_cache_token()
329 self.assertGreater(token_new, token_old)
330 self.assertIsInstance(b, A)
331 self.assertIsInstance(b, (A,))
332
333 def test_registration_builtins(self):
334 class A(metaclass=abc_ABCMeta):

Callers

nothing calls this directly

Calls 5

assertNotIsInstanceMethod · 0.80
assertGreaterMethod · 0.80
assertIsInstanceMethod · 0.80
BClass · 0.70
registerMethod · 0.45

Tested by

no test coverage detected