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
commit8a2daa7d674a52f20a911b3354faeb3ed1aa2ee7 (patch)
treee3b0ac7639fcb90e1be0ad06995c8565ef267f2a /coverage/summary.py
parentf908d802dba1fa1df26d303a7d0cec080a9f494f (diff)
downloadpython-coveragepy-8a2daa7d674a52f20a911b3354faeb3ed1aa2ee7.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 989256f..2a693b8 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(),)