summaryrefslogtreecommitdiff
path: root/test/test_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_parser.py')
-rw-r--r--test/test_parser.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_parser.py b/test/test_parser.py
index 5a66f873..61572be5 100644
--- a/test/test_parser.py
+++ b/test/test_parser.py
@@ -34,3 +34,20 @@ class ParserTest(CoverageTest):
self.assertEqual(cp.exit_counts(), {
2:1, 3:1, 4:2, 5:1, 7:1, 9:1, 10:1
})
+
+ def test_try_except(self):
+ cp = self.parse_source("""\
+ try:
+ a = 2
+ except ValueError:
+ a = 4
+ except ZeroDivideError:
+ a = 6
+ except:
+ a = 8
+ b = 9
+ """)
+ self.assertEqual(cp.exit_counts(), {
+ 1: 1, 2:1, 3:1, 4:1, 5:1, 6:1, 7:1, 8:1, 9:1
+ })
+ \ No newline at end of file