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 | 740e8fef774f85c92daa0e6c8c620f7b58769193 (patch) | |
tree | c59b49c68bc3ba7ecc0ffe4b33f6df8a322a3cd7 | |
parent | 7f53916e61839c18b3e06f56e898f1df55afed1d (diff) | |
download | python-coveragepy-git-740e8fef774f85c92daa0e6c8c620f7b58769193.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 820ce8b1..30a028e3 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") |