diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-10-20 22:34:12 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-10-20 22:34:12 -0400 |
commit | 2b36e7bc4b3c6a6312685ffab67b8ac931e30c6e (patch) | |
tree | af1be7bf43caf3a63a7577e814b90d0b63fd1b44 | |
parent | c2a1170b310ecb76e4783edffab2a9494274026a (diff) | |
download | python-coveragepy-2b36e7bc4b3c6a6312685ffab67b8ac931e30c6e.tar.gz |
Slow progress on adding arc measurement tests.
-rw-r--r-- | test/test_arcs.py | 18 |
1 files changed, 17 insertions, 1 deletions
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") |