summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/html.py12
-rw-r--r--coverage/htmlfiles/pyfile.html1
-rw-r--r--coverage/htmlfiles/style.css22
-rw-r--r--test/farm/html/gold_a/style.css27
4 files changed, 48 insertions, 14 deletions
diff --git a/coverage/html.py b/coverage/html.py
index 99b291b4..df7bc03c 100644
--- a/coverage/html.py
+++ b/coverage/html.py
@@ -93,12 +93,16 @@ class HtmlReporter(Reporter):
n_mis = len(analysis.missing)
n_run = n_stm - n_mis
pc_cov = analysis.percent_covered()
-
+
+ missing_branch_arcs = analysis.missing_branch_arcs()
+ n_par = len(missing_branch_arcs)
+
# These classes determine which lines are highlighted by default.
c_run = " run hide"
c_exc = " exc"
c_mis = " mis"
-
+ c_par = " par"
+
ws_tokens = [token.INDENT, token.DEDENT, token.NEWLINE, tokenize.NL]
lines = []
line = []
@@ -120,7 +124,9 @@ class HtmlReporter(Reporter):
line_class += c_exc
if lineno in analysis.missing:
line_class += c_mis
-
+ if lineno in missing_branch_arcs:
+ line_class += c_par
+
lineinfo = {
'html': "".join(line),
'number': lineno,
diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html
index a7cd1d3c..8a0dd4e9 100644
--- a/coverage/htmlfiles/pyfile.html
+++ b/coverage/htmlfiles/pyfile.html
@@ -29,6 +29,7 @@ function toggle_lines(btn, cls) {
<span class='{{c_run.strip}}' onclick='toggle_lines(this, "run")'>{{n_run}} run</span>
<span class='{{c_exc.strip}}' onclick='toggle_lines(this, "exc")'>{{n_exc}} excluded</span>
<span class='{{c_mis.strip}}' onclick='toggle_lines(this, "mis")'>{{n_mis}} missing</span>
+ <span class='{{c_par.strip}}' onclick='toggle_lines(this, "par")'>{{n_par}} partial</span>
</h2>
</div>
</div>
diff --git a/coverage/htmlfiles/style.css b/coverage/htmlfiles/style.css
index 34ab10e3..b55e4992 100644
--- a/coverage/htmlfiles/style.css
+++ b/coverage/htmlfiles/style.css
@@ -125,23 +125,27 @@ td.text {
background: #eeeeee;
border-left: 2px solid #808080;
}
+.text p.par {
+ background: #ffffdd;
+ border-left: 2px solid #ffff00;
+ }
.text p.hide {
background: inherit;
}
/* Syntax coloring */
.text .com {
- color: green;
- font-style: italic;
- line-height: 1px;
- }
+ color: green;
+ font-style: italic;
+ line-height: 1px;
+ }
.text .key {
- font-weight: bold;
- line-height: 1px;
- }
+ font-weight: bold;
+ line-height: 1px;
+ }
.text .str {
- color: #000080;
- }
+ color: #000080;
+ }
/* index styles */
#index td, #index th {
diff --git a/test/farm/html/gold_a/style.css b/test/farm/html/gold_a/style.css
index 5290bbd3..b55e4992 100644
--- a/test/farm/html/gold_a/style.css
+++ b/test/farm/html/gold_a/style.css
@@ -1,4 +1,4 @@
-/* CSS styles for coverage.py */
+/* CSS styles for Coverage. */
/* Page-wide styles */
html, body, h1, h2, h3, p, td, th {
margin: 0;
@@ -54,6 +54,11 @@ a.nav:hover {
}
#footer {
+ margin: 1em 3em;
+ }
+
+#footer .content {
+ padding: 0;
font-size: 85%;
font-family: verdana, sans-serif;
color: #666666;
@@ -65,7 +70,7 @@ a.nav:hover {
}
/* Header styles */
-.content {
+#header .content {
padding: 1em 3em;
}
@@ -120,10 +125,28 @@ td.text {
background: #eeeeee;
border-left: 2px solid #808080;
}
+.text p.par {
+ background: #ffffdd;
+ border-left: 2px solid #ffff00;
+ }
.text p.hide {
background: inherit;
}
+/* Syntax coloring */
+.text .com {
+ color: green;
+ font-style: italic;
+ line-height: 1px;
+ }
+.text .key {
+ font-weight: bold;
+ line-height: 1px;
+ }
+.text .str {
+ color: #000080;
+ }
+
/* index styles */
#index td, #index th {
text-align: right;