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 @@ -2138,6 +2138,24 @@ def test_bool_notimplemented(self):
2138
2138
with self .assertRaisesRegex (TypeError , msg ):
2139
2139
not NotImplemented
2140
2140
2141
+ def test_singleton_attribute_access (self ):
2142
+ for singleton in (NotImplemented , Ellipsis ):
2143
+ with self .subTest (singleton ):
2144
+ self .assertIs (type (singleton ), singleton .__class__ )
2145
+ self .assertIs (type (singleton ).__class__ , type )
2146
+
2147
+ # Missing instance attributes:
2148
+ with self .assertRaises (AttributeError ):
2149
+ singleton .prop = 1
2150
+ with self .assertRaises (AttributeError ):
2151
+ singleton .prop
2152
+
2153
+ # Missing class attributes:
2154
+ with self .assertRaises (TypeError ):
2155
+ type(singleton ).prop = 1
2156
+ with self .assertRaises (AttributeError ):
2157
+ type (singleton ).prop
2158
+
2141
2159
2142
2160
class TestBreakpoint (unittest .TestCase ):
2143
2161
def setUp (self ):
You can’t perform that action at this time.
0 commit comments