Warning required when calling register() on an ABCMeta subclass.
This commit is contained in:
Christian Heimes 2007-11-30 14:32:41 +00:00
parent c896700235
commit 2e510fb920
2 changed files with 11 additions and 1 deletions

View file

@ -146,6 +146,13 @@ class TestABC(unittest.TestCase):
C()
self.assertEqual(B.counter, 1)
def test_error_on_subclass(self):
class A(abc.ABCMeta):
pass
class B:
pass
self.assertRaises(TypeError, A.register, B)
def test_main():
test_support.run_unittest(TestABC)