diff options
Diffstat (limited to 'Lib/test/test_abc.py')
-rw-r--r-- | Lib/test/test_abc.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py index 653c957b81..3498524501 100644 --- a/Lib/test/test_abc.py +++ b/Lib/test/test_abc.py @@ -96,6 +96,19 @@ class TestLegacyAPI(unittest.TestCase): class TestABC(unittest.TestCase): + def test_ABC_helper(self): + # create an ABC using the helper class and perform basic checks + class C(abc.ABC): + @classmethod + @abc.abstractmethod + def foo(cls): return cls.__name__ + self.assertEqual(type(C), abc.ABCMeta) + self.assertRaises(TypeError, C) + class D(C): + @classmethod + def foo(cls): return super().foo() + self.assertEqual(D.foo(), 'D') + def test_abstractmethod_basics(self): @abc.abstractmethod def foo(self): pass |