diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-02-03 06:50:09 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-02-03 06:50:09 -0500 |
commit | cc94a7dd39c02c4dfb40449cda66063ba9ec72f4 (patch) | |
tree | e71fb5d0696bc14a7cebbd6c8aab68accc5d270c /coverage/html.py | |
parent | 0a792695acfa3a0c2a150d2164317a71563d8e82 (diff) | |
download | python-coveragepy-cc94a7dd39c02c4dfb40449cda66063ba9ec72f4.tar.gz |
A way to show much longer explanations about lines in the HTML report.
Diffstat (limited to 'coverage/html.py')
-rw-r--r-- | coverage/html.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/coverage/html.py b/coverage/html.py index 6a2132b..ce39453 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -96,7 +96,7 @@ class HtmlReporter(Reporter): '__version__': coverage.__version__, } self.source_tmpl = Templite( - data("pyfile.html"), self.template_globals + data("pyfile.html"), self.template_globals, ) self.coverage = cov @@ -204,7 +204,7 @@ class HtmlReporter(Reporter): # Figure out how to mark this line. line_class = [] annotate_html = "" - annotate_title = "" + annotate_long = "" if lineno in analysis.statements: line_class.append("stm") if lineno in analysis.excluded: @@ -226,15 +226,14 @@ class HtmlReporter(Reporter): # 219B is RIGHTWARDS ARROW WITH STROKE. short_fmt = "%s ↛ %s" annotate_html = ", ".join(short_fmt % (lineno, d) for d in shorts) - annotate_html += " [?]" - annotate_title = "Line %d was executed, but never jumped to " % lineno + annotate_long = "Line %d was executed, but never jumped to " % lineno if len(longs) == 1: - annotate_title += longs[0] + annotate_long += longs[0] elif len(longs) == 2: - annotate_title += longs[0] + " or " + longs[1] + annotate_long += longs[0] + " or " + longs[1] else: - annotate_title += ", ".join(longs[:-1]) + ", or " + longs[-1] + annotate_long += ", ".join(longs[:-1]) + ", or " + longs[-1] elif lineno in analysis.statements: line_class.append(c_run) @@ -254,7 +253,7 @@ class HtmlReporter(Reporter): 'number': lineno, 'class': ' '.join(line_class) or "pln", 'annotate': annotate_html, - 'annotate_title': annotate_title, + 'annotate_long': annotate_long, }) # Write the HTML page for this file. |