summaryrefslogtreecommitdiff
path: root/coverage/htmlfiles
diff options
context:
space:
mode:
authorStephan Richter <stephan.richter@gmail.com>2019-01-24 07:44:59 -0500
committerNed Batchelder <ned@nedbatchelder.com>2019-06-10 17:15:32 -0400
commit0f5c9347aa8c72d853f49761d5580a770c4fd39f (patch)
tree82e0a136a16456d2df85f803a3ed9dc3da66d5ee /coverage/htmlfiles
parent5c157a28c46b2f5ed9e9051e5b6c8d461b490f1b (diff)
downloadpython-coveragepy-git-0f5c9347aa8c72d853f49761d5580a770c4fd39f.tar.gz
Extend HTML report to to show contexts for every covered line.
Diffstat (limited to 'coverage/htmlfiles')
-rw-r--r--coverage/htmlfiles/pyfile.html17
-rw-r--r--coverage/htmlfiles/style.css47
2 files changed, 64 insertions, 0 deletions
diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html
index 245ecf41..025ae797 100644
--- a/coverage/htmlfiles/pyfile.html
+++ b/coverage/htmlfiles/pyfile.html
@@ -88,6 +88,23 @@
</p>
{% endfor %}
</td>
+ {% if show_contexts -%}
+ <td class="contexts">
+ {% for line in lines -%}
+ <p>{#-#}
+ {% if line.contexts -%}
+ <span class="context-button">ctx</span>{#-#}
+ <span class="context-list">
+ {% for context in line.contexts -%}
+ <span class="context-line">{{context}}</span>{#-#}
+ {% endfor -%}
+ </span>{#-#}
+ {% endif -%}
+ &nbsp;
+ </p>{#-#}
+ {% endfor %}
+ </td>
+ {% endif -%}
</tr>
</table>
</div>
diff --git a/coverage/htmlfiles/style.css b/coverage/htmlfiles/style.css
index 41bcf2be..c663ed33 100644
--- a/coverage/htmlfiles/style.css
+++ b/coverage/htmlfiles/style.css
@@ -297,6 +297,53 @@ td.text {
color: #000080;
}
+td.contexts p {
+ margin: 0;
+ padding: 0 .5em;
+ color: #999999;
+ font-family: verdana, sans-serif;
+ white-space: nowrap;
+ position: relative;
+ }
+
+td.contexts p:hover {
+ background: #eee;
+ }
+
+td.contexts p span.context-list {
+ display: none;
+ }
+
+td.contexts p:hover span.context-list {
+ display: block;
+ min-width: 30em;
+ //max-width: 50%;
+ white-space: normal;
+ float: right;
+ position: absolute;
+ top: 1.75em;
+ right: 1em;
+ height: auto;
+ color: #333;
+ background: #ffffcc;
+ border: 1px solid #888;
+ padding: .25em .5em;
+ z-index: 999;
+ border-radius: .2em;
+ box-shadow: #cccccc .2em .2em .2em;
+ }
+
+span.context-list span.context-line {
+ display: block;
+}
+
+td.contexts p span.context-button {
+ display: inline-block;
+ cursor: pointer;
+ font-size: .8333em; /* 10/12 */
+ line-height: 1em;
+ }
+
/* index styles */
#index td, #index th {
text-align: right;