summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index ebe60c1..be2cca1 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -314,6 +314,18 @@ class ExceptionTests(unittest.TestCase):
x = DerivedException(fancy_arg=42)
self.assertEquals(x.fancy_arg, 42)
+ def testInfiniteRecursion(self):
+ def f():
+ return f()
+ self.assertRaises(RuntimeError, f)
+
+ def g():
+ try:
+ return g()
+ except ValueError:
+ return -1
+ self.assertRaises(RuntimeError, g)
+
def test_main():
run_unittest(ExceptionTests)