summaryrefslogtreecommitdiff
path: root/coverage/html.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-10-24 20:30:15 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-10-24 20:30:15 -0400
commit02e3d4392b25b8c3fff9e7a00c86665d26fe1ba9 (patch)
tree60119cf1f29a43becb47c2a6f8bdc14a8707777a /coverage/html.py
parentd18f41158f3e282c84169816d0f0261e52a02046 (diff)
downloadpython-coveragepy-git-02e3d4392b25b8c3fff9e7a00c86665d26fe1ba9.tar.gz
Commonalize the computation of total coverage percentage for a file.
Diffstat (limited to 'coverage/html.py')
-rw-r--r--coverage/html.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/coverage/html.py b/coverage/html.py
index 9a68b2c1..99b291b4 100644
--- a/coverage/html.py
+++ b/coverage/html.py
@@ -92,11 +92,8 @@ class HtmlReporter(Reporter):
n_exc = len(analysis.excluded)
n_mis = len(analysis.missing)
n_run = n_stm - n_mis
- if n_stm > 0:
- pc_cov = 100.0 * n_run / n_stm
- else:
- pc_cov = 100.0
-
+ pc_cov = analysis.percent_covered()
+
# These classes determine which lines are highlighted by default.
c_run = " run hide"
c_exc = " exc"