diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index a7631f92e7ea81..a7b35be936f8d9 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -2138,6 +2138,22 @@ def test_bool_notimplemented(self): with self.assertRaisesRegex(TypeError, msg): not NotImplemented + def test_not_implemented(self): + self.assertIs(type(NotImplemented), NotImplemented.__class__) + self.assertIs(type(NotImplemented).__class__, type) + + # Missing instance attributes: + with self.assertRaises(AttributeError): + NotImplemented.prop + with self.assertRaises(AttributeError): + NotImplemented.prop = 1 + + # Missing class attributes: + with self.assertRaises(AttributeError): + type(NotImplemented).prop + with self.assertRaises(TypeError): + type(NotImplemented).prop = 1 + class TestBreakpoint(unittest.TestCase): def setUp(self):