From 24145b0bb0368868b8aa2e8cc0eb43324533367d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 13 Feb 2016 07:48:10 -0500 Subject: More progress on better missed-branch descriptions --- coverage/html.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'coverage/html.py') 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) -- cgit v1.2.1