mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
type.__abstractmethods__ should raise an AttributeError #10006
This commit is contained in:
parent
ea8676bf8b
commit
aec5fd1397
3 changed files with 14 additions and 2 deletions
|
@ -98,6 +98,13 @@ class TestABC(unittest.TestCase):
|
|||
self.assertRaises(TypeError, F) # because bar is abstract now
|
||||
self.assertTrue(isabstract(F))
|
||||
|
||||
def test_type_has_no_abstractmethods(self):
|
||||
# type pretends not to have __abstractmethods__.
|
||||
self.assertRaises(AttributeError, getattr, type, "__abstractmethods__")
|
||||
class meta(type):
|
||||
pass
|
||||
self.assertRaises(AttributeError, getattr, meta, "__abstractmethods__")
|
||||
|
||||
def test_registration_basics(self):
|
||||
class A(metaclass=abc.ABCMeta):
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue