summaryrefslogtreecommitdiff
path: root/coverage/html.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-02-13 07:48:10 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-02-13 07:48:10 -0500
commit80e701b43f04f6ecca44a11f8c24d8ddfb74d662 (patch)
tree2f2cd10b6fde059f5bde29853d71e145f7ed2f6f /coverage/html.py
parent1c38106236a2c75cb2e3bb072e402af218408081 (diff)
downloadpython-coveragepy-80e701b43f04f6ecca44a11f8c24d8ddfb74d662.tar.gz
More progress on better missed-branch descriptions
Diffstat (limited to 'coverage/html.py')
-rw-r--r--coverage/html.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/coverage/html.py b/coverage/html.py
index 5b792c7..0d6e6f9 100644
--- a/coverage/html.py
+++ b/coverage/html.py
@@ -226,13 +226,13 @@ class HtmlReporter(Reporter):
short_fmt = "%s&#x202F;&#x219B;&#x202F;%s"
annotate_html = ",&nbsp;&nbsp; ".join(short_fmt % (lineno, d) for d in shorts)
- annotate_long = "Line %d was executed, but didn't " % lineno
if len(longs) == 1:
- annotate_long += longs[0]
- elif len(longs) == 2:
- annotate_long += longs[0] + " or " + longs[1]
+ annotate_long = longs[0]
else:
- annotate_long += ", ".join(longs[:-1]) + ", or " + longs[-1]
+ annotate_long = "%d missed branches: %s" % (
+ len(longs),
+ ", ".join("%d) %s" % (num, ann_long) for num, ann_long in enumerate(longs, start=1)),
+ )
elif lineno in analysis.statements:
line_class.append(c_run)