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

Method test_all_new_methods_are_called

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

Source from the content-addressed store, hash-verified

479 self.assertNotIsSubclass(C, (A,))
480
481 def test_all_new_methods_are_called(self):
482 class A(metaclass=abc_ABCMeta):
483 pass
484 class B(object):
485 counter = 0
486 def __new__(cls):
487 B.counter += 1
488 return super().__new__(cls)
489 class C(A, B):
490 pass
491 self.assertEqual(B.counter, 0)
492 C()
493 self.assertEqual(B.counter, 1)
494
495 def test_ABC_has___slots__(self):
496 self.assertHasAttr(abc.ABC, '__slots__')

Callers

nothing calls this directly

Calls 2

CClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected