summaryrefslogtreecommitdiff
path: root/test/test_arcs.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-11-21 13:10:10 -0500
committerNed Batchelder <ned@nedbatchelder.com>2009-11-21 13:10:10 -0500
commitb8c23d479ae5a0da883a59d433193533c7ef63e4 (patch)
treed7c40cace860a55a91b1b9c20de0bc664f769cc9 /test/test_arcs.py
parent9ce4e0e787c7e8f028a2c2f56c50b6d8f663e88c (diff)
downloadpython-coveragepy-git-b8c23d479ae5a0da883a59d433193533c7ef63e4.tar.gz
Don't count branches to excluded code. Tests don't pass yet.
Diffstat (limited to 'test/test_arcs.py')
-rw-r--r--test/test_arcs.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_arcs.py b/test/test_arcs.py
index dea3700f..effc6e52 100644
--- a/test/test_arcs.py
+++ b/test/test_arcs.py
@@ -113,6 +113,29 @@ class SimpleArcTest(CoverageTest):
arcz=".1 16 67 7. .2 23 24 3. 45 5.", arcz_missing=""
)
+ def test_dont_confuse_exit_and_else(self):
+ self.check_coverage("""\
+ def foo():
+ if foo:
+ a = 3
+ else:
+ a = 5
+ return a
+ assert foo() == 3
+ """,
+ arcz=".1 17 7. .2 23 36 25 56 6.", arcz_missing="25 56"
+ )
+ self.check_coverage("""\
+ def foo():
+ if foo:
+ a = 3
+ else:
+ a = 5
+ foo()
+ """,
+ arcz=".1 16 6. .2 23 3. 25 5.", arcz_missing="25 5."
+ )
+
class LoopArcTest(CoverageTest):
"""Arc-measuring tests involving loops."""