diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-02-13 07:48:10 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-02-13 07:48:10 -0500 |
commit | 24145b0bb0368868b8aa2e8cc0eb43324533367d (patch) | |
tree | 2c2bf2ac5cfb28309a02c2b365b05faf42ed7f50 /coverage/html.py | |
parent | 9047a7742ad67bb36440299c2ef1e48ee7108c20 (diff) | |
download | python-coveragepy-git-24145b0bb0368868b8aa2e8cc0eb43324533367d.tar.gz |
More progress on better missed-branch descriptions
Diffstat (limited to 'coverage/html.py')
-rw-r--r-- | coverage/html.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/coverage/html.py b/coverage/html.py index 5b792c7e..0d6e6f96 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -226,13 +226,13 @@ class HtmlReporter(Reporter): short_fmt = "%s ↛ %s" annotate_html = ", ".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) |