summaryrefslogtreecommitdiff
path: root/coverage/results.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-04-20 12:21:15 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-04-20 12:21:15 -0400
commit1b81747e52752a30be1c4271e24d23a7cb3f71b4 (patch)
tree8297b06a003a0c1a79c2bf391d2c0f0cfb128d81 /coverage/results.py
parent03eb833bac7731bd6dfd4ca5d0eae1da7213eb57 (diff)
parentde4cfde7b1f7b3d3bee11a26b4c1bb3ae598259c (diff)
downloadpython-coveragepy-git-1b81747e52752a30be1c4271e24d23a7cb3f71b4.tar.gz
Merge issue-324 fix
Diffstat (limited to 'coverage/results.py')
-rw-r--r--coverage/results.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/coverage/results.py b/coverage/results.py
index c1718d46..7b621c18 100644
--- a/coverage/results.py
+++ b/coverage/results.py
@@ -101,10 +101,13 @@ class Analysis(object):
# Exclude arcs here which connect a line to itself. They can occur
# in executed data in some cases. This is where they can cause
# trouble, and here is where it's the least burden to remove them.
+ # Also, generators can somehow cause arcs from "enter" to "exit", so
+ # make sure we have at least one positive value.
unpredicted = (
e for e in executed
if e not in possible
and e[0] != e[1]
+ and (e[0] > 0 or e[1] > 0)
)
return sorted(unpredicted)