From 02e3d4392b25b8c3fff9e7a00c86665d26fe1ba9 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 24 Oct 2009 20:30:15 -0400 Subject: Commonalize the computation of total coverage percentage for a file. --- coverage/summary.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'coverage/summary.py') 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(),) -- cgit v1.2.1