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