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

Method test_isinstance_invalidation

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

Source from the content-addressed store, hash-verified

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