From 8ceb28bbfa180e44e1737e21f55254589979b6d9 Mon Sep 17 00:00:00 2001 From: Matthew Boehm Date: Thu, 2 Jun 2016 19:13:30 -0400 Subject: 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. --- coverage/report.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'coverage/report.py') 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 -- cgit v1.2.1