diff options
Diffstat (limited to 'Lib/test/test_super.py')
-rw-r--r-- | Lib/test/test_super.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_super.py b/Lib/test/test_super.py index f6469cf..1e272ee 100644 --- a/Lib/test/test_super.py +++ b/Lib/test/test_super.py @@ -130,6 +130,19 @@ class TestSuper(unittest.TestCase): super() self.assertRaises(RuntimeError, X().f) + def test_cell_as_self(self): + class X: + def meth(self): + super() + + def f(): + k = X() + def g(): + return k + return g + c = f().__closure__[0] + self.assertRaises(TypeError, X.meth, c) + def test_main(): support.run_unittest(TestSuper) |