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