Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added layered test case
  • Loading branch information
ben avrahami
ben avrahami committed Oct 4, 2020
commit ba8df080f0f4ccb092e73d13098b6a6cf675c6e0
22 changes: 22 additions & 0 deletions Lib/test/test_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,28 @@ def foo(self):
msg = "class B with abstract method foo"
self.assertRaisesRegex(TypeError, msg, B)

def test_update_layered_implementation(self):
class A(metaclass=abc_ABCMeta):
@abc.abstractmethod
def foo(self):
pass

class B(A):
pass

class C(B):
def foo(self):
pass

C()

del C.foo

abc.update_abstractmethods(C)

msg = "class C with abstract method foo"
self.assertRaisesRegex(TypeError, msg, C)



class TestABCWithInitSubclass(unittest.TestCase):
Expand Down