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

Method test_update_implementation

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

Source from the content-addressed store, hash-verified

541 self.assertRaisesRegex(TypeError, msg, A)
542
543 def test_update_implementation(self):
544 class A(metaclass=abc_ABCMeta):
545 @abc.abstractmethod
546 def foo(self):
547 pass
548
549 class B(A):
550 pass
551
552 msg = "class B without an implementation for abstract method 'foo'"
553 self.assertRaisesRegex(TypeError, msg, B)
554 self.assertEqual(B.__abstractmethods__, {'foo'})
555
556 B.foo = lambda self: None
557
558 abc.update_abstractmethods(B)
559
560 B()
561 self.assertEqual(B.__abstractmethods__, set())
562
563 def test_update_as_decorator(self):
564 class A(metaclass=abc_ABCMeta):

Callers

nothing calls this directly

Calls 4

setFunction · 0.85
assertRaisesRegexMethod · 0.80
BClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected