diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-11-20 16:40:44 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-11-20 16:40:44 (GMT) |
commit | e516265bbc75e4bb7fc2ab6eaeb7ad3aef86a938 (patch) | |
tree | 0436a95d2a4ca7b01c238eb6df780798388321df /Lib/test/test_inspect.py | |
parent | 6bb9989ae38cd2610e661d6e8899ef58dd9562e3 (diff) | |
download | cpython-e516265bbc75e4bb7fc2ab6eaeb7ad3aef86a938.zip cpython-e516265bbc75e4bb7fc2ab6eaeb7ad3aef86a938.tar.gz cpython-e516265bbc75e4bb7fc2ab6eaeb7ad3aef86a938.tar.bz2 |
Issue 9732: fetch the method resolution order from the type metaclass directly in getattr_static
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r-- | Lib/test/test_inspect.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index e320c68..b3e131c 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -867,6 +867,22 @@ class TestGetattrStatic(unittest.TestCase): self.assertEqual(inspect.getattr_static(Something(), 'foo'), 3) self.assertEqual(inspect.getattr_static(Something, 'foo'), 3) + def test_mro_as_property(self): + class Meta(type): + @property + def __mro__(self): + return (object,) + + class Base(object): + foo = 3 + + class Something(Base, metaclass=Meta): + pass + + self.assertEqual(inspect.getattr_static(Something(), 'foo'), 3) + self.assertEqual(inspect.getattr_static(Something, 'foo'), 3) + + def test_main(): run_unittest( TestDecorators, TestRetrievingSourceCode, TestOneliners, TestBuggyCases, |