summaryrefslogtreecommitdiff
path: root/coverage/summary.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/summary.py
parentd18f41158f3e282c84169816d0f0261e52a02046 (diff)
downloadpython-coveragepy-git-02e3d4392b25b8c3fff9e7a00c86665d26fe1ba9.tar.gz
Commonalize the computation of total coverage percentage for a file.
Diffstat (limited to 'coverage/summary.py')
-rw-r--r--coverage/summary.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/coverage/summary.py b/coverage/summary.py
index 989256fc..2a693b82 100644
--- a/coverage/summary.py
+++ b/coverage/summary.py
@@ -44,10 +44,7 @@ class SummaryReporter(Reporter):
analysis = self.coverage._analyze(cu)
n = len(analysis.statements)
m = n - len(analysis.missing)
- if n > 0:
- pc = 100.0 * m / n
- else:
- pc = 100.0
+ pc = analysis.percent_covered()
args = (cu.name, n, m, pc)
if self.show_missing:
args = args + (analysis.missing_formatted(),)