summaryrefslogtreecommitdiff
path: root/coverage/summary.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-08-22 23:18:14 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-08-22 23:18:14 -0400
commit32320cabc97ccca3f2492faa55b542c4a158c2c9 (patch)
tree787b10a7e7c1f1ce4b24e13f68c8b0b85e48f5de /coverage/summary.py
parent98ca1822da51c3c73201d04966656e605c21a6a5 (diff)
downloadpython-coveragepy-32320cabc97ccca3f2492faa55b542c4a158c2c9.tar.gz
Unify formatting of coverage percentages, and don't show zero or 100 as a result of rounding. Fixes #41 and #70.
Diffstat (limited to 'coverage/summary.py')
-rw-r--r--coverage/summary.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/coverage/summary.py b/coverage/summary.py
index 37039ba..53c844d 100644
--- a/coverage/summary.py
+++ b/coverage/summary.py
@@ -32,7 +32,7 @@ class SummaryReporter(Reporter):
header += " Branch BrPart"
fmt_coverage += " %6d %6d"
header += " Cover"
- fmt_coverage += " %5d%%"
+ fmt_coverage += " %5s%%"
if self.show_missing:
header += " Missing"
fmt_coverage += " %s"
@@ -56,7 +56,7 @@ class SummaryReporter(Reporter):
args = (cu.name, nums.n_statements, nums.n_missing)
if self.branches:
args += (nums.n_branches, nums.n_missing_branches)
- args += (nums.pc_covered,)
+ args += (nums.pc_covered_str,)
if self.show_missing:
args += (analysis.missing_formatted(),)
outfile.write(fmt_coverage % args)
@@ -73,7 +73,7 @@ class SummaryReporter(Reporter):
args = ("TOTAL", total.n_statements, total.n_missing)
if self.branches:
args += (total.n_branches, total.n_missing_branches)
- args += (total.pc_covered,)
+ args += (total.pc_covered_str,)
if self.show_missing:
args += ("",)
outfile.write(fmt_coverage % args)