summaryrefslogtreecommitdiff
path: root/coverage/report.py
diff options
context:
space:
mode:
authorMatthew Boehm <boehm.matthew@gmail.com>2016-06-02 19:13:30 -0400
committerMatthew Boehm <boehm.matthew@gmail.com>2016-06-02 19:13:30 -0400
commit8ceb28bbfa180e44e1737e21f55254589979b6d9 (patch)
tree6f9b22da79346ba322147158d1c4d7a9c153eacc /coverage/report.py
parent4c4b175dedd8b45200b577947b3dd56bfdfb8822 (diff)
downloadpython-coveragepy-8ceb28bbfa180e44e1737e21f55254589979b6d9.tar.gz
Emit a warning when an invalid file is detected with ignore_errors=true.
Previously, when an invalid file was encountered, it would be silently ignored.
Diffstat (limited to 'coverage/report.py')
-rw-r--r--coverage/report.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/coverage/report.py b/coverage/report.py
index 2ffbbaa..981657c 100644
--- a/coverage/report.py
+++ b/coverage/report.py
@@ -97,5 +97,8 @@ class Reporter(object):
# explicitly suppress those errors.
# NotPython is only raised by PythonFileReporter, which has a
# should_be_python() method.
- if fr.should_be_python() and not self.config.ignore_errors:
- raise
+ if fr.should_be_python():
+ if self.config.ignore_errors:
+ self.coverage._warn("Could not parse python file {0}".format(fr.filename))
+ else:
+ raise