summaryrefslogtreecommitdiff
path: root/coverage/report.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/report.py')
-rw-r--r--coverage/report.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/coverage/report.py b/coverage/report.py
index 0fb353a2..6c5510ad 100644
--- a/coverage/report.py
+++ b/coverage/report.py
@@ -2,7 +2,7 @@
import fnmatch, os
from coverage.codeunit import code_unit_factory
-from coverage.misc import CoverageException, NoSource
+from coverage.misc import CoverageException, NoSource, NotPython
class Reporter(object):
"""A base class for all reporters."""
@@ -61,7 +61,13 @@ class Reporter(object):
def report_files(self, report_fn, morfs, config, directory=None):
"""Run a reporting function on a number of morfs.
- `report_fn` is called for each relative morf in `morfs`.
+ `report_fn` is called for each relative morf in `morfs`. It is called
+ as::
+
+ report_fn(code_unit, analysis)
+
+ where `code_unit` is the `CodeUnit` for the morf, and `analysis` is
+ the `Analysis` for the morf.
`config` is a CoverageConfig instance.
@@ -78,6 +84,6 @@ class Reporter(object):
for cu in self.code_units:
try:
report_fn(cu, self.coverage._analyze(cu))
- except NoSource:
+ except (NoSource, NotPython):
if not self.ignore_errors:
raise