diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-08 20:47:11 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-08 20:47:11 -0500 |
commit | 5676761b0d1d2d3bddb1cea6a69280f8ec7765d9 (patch) | |
tree | d0d5bdfda92fd8a230022439fc21c1ef92efe266 /coverage | |
parent | 9a751db51cbcce4ab504e9afe59a08ce0a0bd40e (diff) | |
download | python-coveragepy-git-5676761b0d1d2d3bddb1cea6a69280f8ec7765d9.tar.gz |
Annotations on yellow HTML lines with the line numbers not visited.
Diffstat (limited to 'coverage')
-rw-r--r-- | coverage/html.py | 5 | ||||
-rw-r--r-- | coverage/htmlfiles/pyfile.html | 2 | ||||
-rw-r--r-- | coverage/htmlfiles/style.css | 11 |
3 files changed, 16 insertions, 2 deletions
diff --git a/coverage/html.py b/coverage/html.py index b5923351..dd769b57 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -114,6 +114,7 @@ class HtmlReporter(Reporter): if part == '\n': line_class = "" + annotate = "" if lineno in analysis.statements: line_class += " stm" if lineno in analysis.excluded: @@ -123,13 +124,15 @@ class HtmlReporter(Reporter): elif self.arcs and lineno in missing_branch_arcs: line_class += c_par n_par += 1 + annotate = " ".join(map(str, missing_branch_arcs[lineno])) elif lineno in analysis.statements: line_class += c_run lineinfo = { 'html': "".join(line), 'number': lineno, - 'class': line_class.strip() or "pln" + 'class': line_class.strip() or "pln", + 'annotate': annotate, } lines.append(lineinfo) diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html index 8ae27eab..ca65152d 100644 --- a/coverage/htmlfiles/pyfile.html +++ b/coverage/htmlfiles/pyfile.html @@ -47,7 +47,7 @@ function toggle_lines(btn, cls) { </td>
<td class='text' valign='top'>
{% for line in lines %}
- <p class='{{line.class}}'>{{line.html}}<span class="strut"> </span></p>
+ <p class='{{line.class}}'>{% if line.annotate %}<span class='annotate'>{{line.annotate}}</span>{% endif %}{{line.html}}<span class='strut'> </span></p>
{% endfor %}
</td>
</tr>
diff --git a/coverage/htmlfiles/style.css b/coverage/htmlfiles/style.css index 7c2ae797..65a27905 100644 --- a/coverage/htmlfiles/style.css +++ b/coverage/htmlfiles/style.css @@ -133,6 +133,17 @@ td.text { background: inherit; } +.text span.annotate { + font-family: georgia; + font-style: italic; + color: #666; + float: right; + padding-right: .5em; + } +.text p.hide span.annotate { + display: none; + } + /* Syntax coloring */ .text .com { color: green; |