summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_super.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_super.py')
-rw-r--r--Lib/test/test_super.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_super.py b/Lib/test/test_super.py
index 698ab48..664cf70 100644
--- a/Lib/test/test_super.py
+++ b/Lib/test/test_super.py
@@ -410,6 +410,18 @@ class TestSuper(unittest.TestCase):
self.assertEqual(C().method(), mysuper)
+ def test_unusual_getattro(self):
+ class MyType(type):
+ pass
+
+ def test(name):
+ mytype = MyType(name, (MyType,), {})
+ super(MyType, type(mytype)).__setattr__(mytype, "bar", 1)
+ self.assertEqual(mytype.bar, 1)
+
+ test("foo1")
+ test("foo2")
+
if __name__ == "__main__":
unittest.main()