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

Method test_update_layered_implementation

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

Source from the content-addressed store, hash-verified

610 self.assertRaisesRegex(TypeError, msg, B)
611
612 def test_update_layered_implementation(self):
613 class A(metaclass=abc_ABCMeta):
614 @abc.abstractmethod
615 def foo(self):
616 pass
617
618 class B(A):
619 pass
620
621 class C(B):
622 def foo(self):
623 pass
624
625 C()
626
627 del C.foo
628
629 abc.update_abstractmethods(C)
630
631 msg = "class C without an implementation for abstract method 'foo'"
632 self.assertRaisesRegex(TypeError, msg, C)
633
634 def test_update_multi_inheritance(self):
635 class A(metaclass=abc_ABCMeta):

Callers

nothing calls this directly

Calls 2

assertRaisesRegexMethod · 0.80
CClass · 0.70

Tested by

no test coverage detected