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

Method test_update_as_decorator

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

Source from the content-addressed store, hash-verified

560 self.assertEqual(B.__abstractmethods__, set())
561
562 def test_update_as_decorator(self):
563 class A(metaclass=abc_ABCMeta):
564 @abc.abstractmethod
565 def foo(self):
566 pass
567
568 def class_decorator(cls):
569 cls.foo = lambda self: None
570 return cls
571
572 @abc.update_abstractmethods
573 @class_decorator
574 class B(A):
575 pass
576
577 B()
578 self.assertEqual(B.__abstractmethods__, set())
579
580 def test_update_non_abc(self):
581 class A:

Callers

nothing calls this directly

Calls 3

setFunction · 0.85
BClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected