type.__abstractmethods__ should raise an AttributeError #10006
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
index bc09506..3a1d76b 100644
--- a/Lib/test/test_abc.py
+++ b/Lib/test/test_abc.py
@@ -98,6 +98,13 @@
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