diff options
-rw-r--r-- | coverage/html.py | 11 | ||||
-rw-r--r-- | coverage/htmlfiles/pyfile.html | 6 |
2 files changed, 11 insertions, 6 deletions
diff --git a/coverage/html.py b/coverage/html.py index ada19d93..41901b45 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -61,6 +61,11 @@ class HtmlReporter(Reporter): else: pc_cov = 100.0 + # These classes determine which lines are highlighted by default. + c_run = " run hide" + c_exc = " exc" + c_mis = " mis" + lines = [] for lineno, line in enumerate(source_lines): lineno += 1 # enum is 0-based, lines are 1-based. @@ -70,11 +75,11 @@ class HtmlReporter(Reporter): if lineno in statements: css_class += " stm" if lineno not in missing and lineno not in excluded: - css_class += " run hide" + css_class += c_run if lineno in excluded: - css_class += " exc" + css_class += c_exc if lineno in missing: - css_class += " mis" + css_class += c_mis lineinfo = { 'text': line, diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html index c39937bd..d4c15c6a 100644 --- a/coverage/htmlfiles/pyfile.html +++ b/coverage/htmlfiles/pyfile.html @@ -26,9 +26,9 @@ function toggle_lines(btn, cls) { </h1>
<h2 class='stats'>
{{n_stm}} statements
- <span class='run hide' onclick='toggle_lines(this, "run")'>{{n_run}} run</span>
- <span class='exc' onclick='toggle_lines(this, "exc")'>{{n_exc}} excluded</span>
- <span class='mis' onclick='toggle_lines(this, "mis")'>{{n_mis}} missing</span>
+ <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>
</h2>
</div>
</div>
|