From 2b36e7bc4b3c6a6312685ffab67b8ac931e30c6e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 20 Oct 2009 22:34:12 -0400 Subject: Slow progress on adding arc measurement tests. --- test/test_arcs.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/test_arcs.py b/test/test_arcs.py index 820ce8b..30a028e 100644 --- a/test/test_arcs.py +++ b/test/test_arcs.py @@ -232,7 +232,7 @@ class ExceptionArcTest(CoverageTest): arcz_missing="68 8B", arcz_unpredicted="58") if sys.hexversion >= 0x02050000: - def test_except_finally_no_exception(self): + def test_except_finally(self): self.check_coverage("""\ a, b, c = 1, 1, 1 try: @@ -244,3 +244,19 @@ class ExceptionArcTest(CoverageTest): assert a == 3 and b == 1 and c == 7 """, arcz=".1 12 23 45 37 57 78 8.", arcz_missing="45 57") + self.check_coverage("""\ + a, b, c = 1, 1, 1 + def oops(x): + if x % 2: raise Exception("odd") + try: + a = 5 + oops(1) + a = 7 + except: + b = 9 + finally: + c = 11 + assert a == 5 and b == 9 and c == 11 + """, + arcz=".1 12 .3 3. 24 45 56 67 7B 89 9B BC C.", + arcz_missing="67 7B", arcz_unpredicted="68") -- cgit v1.2.1