summaryrefslogtreecommitdiff
path: root/coverage/summary.py
diff options
context:
space:
mode:
authorNed Batchelder <nedbat@gmail.com>2015-04-24 21:06:26 -0400
committerNed Batchelder <nedbat@gmail.com>2015-04-24 21:06:26 -0400
commit4cac18d36cd53c85f43ab79816b71cd2d4a3e6db (patch)
tree5741c738325d92c1a417b2c943f9b3f98f3417ba /coverage/summary.py
parent3d88444cd3659fb93f17cbf4288c23bc82f33ead (diff)
parentc3a98ff12933710d751ec28b984edb7936d457d3 (diff)
downloadpython-coveragepy-4cac18d36cd53c85f43ab79816b71cd2d4a3e6db.tar.gz
Merged in lep/coverage.py (pull request #48)
Fix #363: crash when annotating non-ascii characters in python 2.
Diffstat (limited to 'coverage/summary.py')
-rw-r--r--coverage/summary.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/coverage/summary.py b/coverage/summary.py
index 10ac7e2..5b8c903 100644
--- a/coverage/summary.py
+++ b/coverage/summary.py
@@ -20,10 +20,10 @@ class SummaryReporter(Reporter):
`outfile` is a file object to write the summary to.
"""
- self.find_code_units(morfs)
+ self.find_file_reporters(morfs)
# Prepare the formatting strings
- max_name = max([len(cu.name) for cu in self.code_units] + [5])
+ max_name = max([len(fr.name) for fr in self.file_reporters] + [5])
fmt_name = "%%- %ds " % max_name
fmt_err = "%s %s: %s\n"
header = (fmt_name % "Name") + " Stmts Miss"
@@ -50,9 +50,9 @@ class SummaryReporter(Reporter):
total = Numbers()
- for cu in self.code_units:
+ for fr in self.file_reporters:
try:
- analysis = self.coverage._analyze(cu)
+ analysis = self.coverage._analyze(fr)
nums = analysis.numbers
if self.config.skip_covered:
@@ -65,7 +65,7 @@ class SummaryReporter(Reporter):
if no_missing_lines and no_missing_branches:
continue
- args = (cu.name, nums.n_statements, nums.n_missing)
+ args = (fr.name, nums.n_statements, nums.n_missing)
if self.branches:
args += (nums.n_branches, nums.n_partial_branches)
args += (nums.pc_covered_str,)
@@ -84,10 +84,10 @@ class SummaryReporter(Reporter):
report_it = not self.config.ignore_errors
if report_it:
typ, msg = sys.exc_info()[:2]
- if typ is NotPython and not cu.should_be_python():
+ if typ is NotPython and not fr.should_be_python():
report_it = False
if report_it:
- outfile.write(fmt_err % (cu.name, typ.__name__, msg))
+ outfile.write(fmt_err % (fr.name, typ.__name__, msg))
if total.n_files > 1:
outfile.write(rule)