|
|
|
@ -1088,6 +1088,23 @@ class TestGetattrStatic(unittest.TestCase): |
|
|
|
self.assertIsNot(inspect.getattr_static(sys, "version", sentinel), |
|
|
|
sentinel) |
|
|
|
|
|
|
|
def test_metaclass_with_metaclass_with_dict_as_property(self): |
|
|
|
class MetaMeta(type): |
|
|
|
@property |
|
|
|
def __dict__(self): |
|
|
|
self.executed = True |
|
|
|
return dict(spam=42) |
|
|
|
|
|
|
|
class Meta(type, metaclass=MetaMeta): |
|
|
|
executed = False |
|
|
|
|
|
|
|
class Thing(metaclass=Meta): |
|
|
|
pass |
|
|
|
|
|
|
|
with self.assertRaises(AttributeError): |
|
|
|
inspect.getattr_static(Thing, "spam") |
|
|
|
self.assertFalse(Thing.executed) |
|
|
|
|
|
|
|
class TestGetGeneratorState(unittest.TestCase): |
|
|
|
|
|
|
|
def setUp(self): |
|
|
|
|