diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-30 21:35:27 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-30 21:35:27 -0500 |
commit | 9d2b8a09154727bee8c2296ea5852574c22a16cb (patch) | |
tree | 1a43543ed896e037776a218456ec421125547121 /coverage | |
parent | 62cd957d5ff36fa745affac27d23be7d7928b40b (diff) | |
download | python-coveragepy-git-9d2b8a09154727bee8c2296ea5852574c22a16cb.tar.gz |
A little explanation of the partial branch annotations in the HTML report.
Diffstat (limited to 'coverage')
-rw-r--r-- | coverage/html.py | 12 | ||||
-rw-r--r-- | coverage/htmlfiles/pyfile.html | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/coverage/html.py b/coverage/html.py index 6df84a57..3671f036 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -80,7 +80,8 @@ class HtmlReporter(Reporter): lineno += 1 # 1-based line numbers. # Figure out how to mark this line. line_class = "" - annotate = "" + annotate_html = "" + annotate_title = "" if lineno in analysis.statements: line_class += " stm" if lineno in analysis.excluded: @@ -96,7 +97,11 @@ class HtmlReporter(Reporter): annlines.append("exit") else: annlines.append(str(b)) - annotate = " ".join(annlines) + annotate_html = " ".join(annlines) + if len(annlines) > 1: + annotate_title = "no jumps to these line numbers" + elif len(annlines) == 1: + annotate_title = "no jump to this line number" elif lineno in analysis.statements: line_class += c_run @@ -113,7 +118,8 @@ class HtmlReporter(Reporter): 'html': html, 'number': lineno, 'class': line_class.strip() or "pln", - 'annotate': annotate, + 'annotate': annotate_html, + 'annotate_title': annotate_title, }) # Write the HTML page for this file. diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html index 566244f2..62518ba0 100644 --- a/coverage/htmlfiles/pyfile.html +++ b/coverage/htmlfiles/pyfile.html @@ -48,7 +48,7 @@ function toggle_lines(btn, cls) { </td>
<td class='text' valign='top'>
{% for line in lines %}
- <p class='{{line.class}}'>{% if line.annotate %}<span class='annotate'>{{line.annotate}}</span>{% endif %}{{line.html}}<span class='strut'> </span></p>
+ <p class='{{line.class}}'>{% if line.annotate %}<span class='annotate' title='{{line.annotate_title}}'>{{line.annotate}}</span>{% endif %}{{line.html}}<span class='strut'> </span></p>
{% endfor %}
</td>
</tr>
|