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

Method test_abc_implementation

Lib/test/test_dataclasses/__init__.py:4833–4850  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4831
4832class TestAbstract(unittest.TestCase):
4833 def test_abc_implementation(self):
4834 class Ordered(abc.ABC):
4835 @abc.abstractmethod
4836 def __lt__(self, other):
4837 pass
4838
4839 @abc.abstractmethod
4840 def __le__(self, other):
4841 pass
4842
4843 @dataclass(order=True)
4844 class Date(Ordered):
4845 year: int
4846 month: 'Month'
4847 day: 'int'
4848
4849 self.assertFalse(inspect.isabstract(Date))
4850 self.assertGreater(Date(2020,12,25), Date(2020,8,31))
4851
4852 def test_maintain_abc(self):
4853 class A(abc.ABC):

Callers

nothing calls this directly

Calls 3

assertFalseMethod · 0.80
assertGreaterMethod · 0.80
DateClass · 0.70

Tested by

no test coverage detected