8000 added layered test case · python/cpython@ba8df08 · GitHub
[go: up one dir, main page]

Skip to content

Commit ba8df08

Browse files
author
ben avrahami
committed
added layered test case
1 parent 114028e commit ba8df08

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Lib/test/test_abc.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,28 @@ def foo(self):
590590
msg = "class B with abstract method 8000 foo"
591591
self.assertRaisesRegex(TypeError, msg, B)
592592

593+
def test_update_layered_implementation(self):
594+
class A(metaclass=abc_ABCMeta):
595+
@abc.abstractmethod
596+
def foo(self):
597+
pass
598+
599+
class B(A):
600+
pass
601+
602+
class C(B):
603+
def foo(self):
604+
pass
605+
606+
C()
607+
608+
del C.foo
609+
610+
abc.update_abstractmethods(C)
611+
612+
msg = "class C with abstract method foo"
613+
self.assertRaisesRegex(TypeError, msg, C)
614+
593615

594616

595617
class TestABCWithInitSubclass(unittest.TestCase):

0 commit comments

Comments
 (0)
0