diff options
| author | Georg Brandl <georg@python.org> | 2012-09-29 07:27:15 (GMT) |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2012-09-29 07:27:15 (GMT) |
| commit | 99a247fd01c1cd780c0c3ee1116657627f1ee744 (patch) | |
| tree | 319e33cb6612c3fafb2eb82e15c5e85e3d771e4f /Lib/test/test_super.py | |
| parent | 1628eaa5dc8892ff381ca7558cc7c8d80fac494d (diff) | |
| parent | 8ed677db129171317b8ee7cd45b39b9013f5a2d6 (diff) | |
| download | cpython-99a247fd01c1cd780c0c3ee1116657627f1ee744.zip cpython-99a247fd01c1cd780c0c3ee1116657627f1ee744.tar.gz cpython-99a247fd01c1cd780c0c3ee1116657627f1ee744.tar.bz2 | |
Merge with main repo default branch.
Diffstat (limited to 'Lib/test/test_super.py')
| -rw-r--r-- | Lib/test/test_super.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_super.py b/Lib/test/test_super.py index 32eb1c0..f6469cf 100644 --- a/Lib/test/test_super.py +++ b/Lib/test/test_super.py @@ -115,6 +115,21 @@ class TestSuper(unittest.TestCase): return __class__ self.assertIs(X.f(), X) + def test_obscure_super_errors(self): + def f(): + super() + self.assertRaises(RuntimeError, f) + def f(x): + del x + super() + self.assertRaises(RuntimeError, f, None) + class X: + def f(x): + nonlocal __class__ + del __class__ + super() + self.assertRaises(RuntimeError, X().f) + def test_main(): support.run_unittest(TestSuper) |
