File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 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):
21382138 with self .assertRaisesRegex (TypeError , msg ):
21392139 not NotImplemented
21402140
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+
21412159
21422160class TestBreakpoint (unittest .TestCase ):
21432161 def setUp (self ):
You can’t perform that action at this time.
0 commit comments