File tree 1 file changed +18
-0
lines changed 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2091,6 +2091,24 @@ def test_warning_notimplemented(self):
2091
2091
with self .assertWarns (DeprecationWarning ):
2092
2092
self .assertFalse (not NotImplemented )
2093
2093
2094
+ def test_singleton_attribute_access (self ):
2095
+ for singleton in (NotImplemented , Ellipsis ):
2096
+ with self .subTest (singleton ):
2097
+ self .assertIs (type (singleton ), singleton .__class__ )
2098
+ self .assertIs (type (singleton ).__class__ , type )
2099
+
2100
+ # Missing instance attributes:
2101
+ with self .assertRaises (AttributeError ):
2102
+ singleton .prop = 1
2103
+ with self .assertRaises (AttributeError ):
2104
+ singleton .prop
2105
+
2106
+ # Missing class attributes:
2107
+ with self .assertRaises (TypeError ):
2108
+ type(singleton ).prop = 1
2109
+ with self .assertRaises (AttributeError ):
2110
+ type (singleton ).prop
2111
+
2094
2112
2095
2113
class TestBreakpoint (unittest .TestCase ):
2096
2114
def setUp (self ):
You can’t perform that action at this time.
0 commit comments