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
commit5f169673e183ea4de975d7073c62933bb700e055 (patch)
treed0f4b1871e6ccdf3210d8a1b5802add2bfefa65d /coverage/report.py
parent8bce4538ba831aed7a891f8282b8faabdd78bfa2 (diff)
downloadpython-coveragepy-git-5f169673e183ea4de975d7073c62933bb700e055.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 2ffbbaa5..981657c7 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