summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_arcs.py4
-rw-r--r--test/test_parser.py17
2 files changed, 19 insertions, 2 deletions
diff --git a/test/test_arcs.py b/test/test_arcs.py
index 00567ac6..dea3700f 100644
--- a/test/test_arcs.py
+++ b/test/test_arcs.py
@@ -265,8 +265,8 @@ class ExceptionArcTest(CoverageTest):
assert try_it(0) == 8 # C
assert try_it(1) == 6 # D
""",
- arcz=".1 12 .3 3. 24 4C CD D. .5 56 67 78 8B 9A 9B AB B.",
- arcz_missing="9B", # never got an exception other than ValueError
+ arcz=".1 12 .3 3. 24 4C CD D. .5 56 67 78 8B 9A AB B.",
+ arcz_missing="",
arcz_unpredicted="79")
def test_try_finally(self):
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