diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-04-18 07:27:59 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-04-18 07:27:59 -0400 |
commit | 67ea897f611a86fee7e3846ad3c4bc564cac6264 (patch) | |
tree | 0db0e454bdb19340045a8645a5a227e151af2cc3 /coverage/report.py | |
parent | fa22473c99e37399a83ea074b6528fa9496bb038 (diff) | |
download | python-coveragepy-git-67ea897f611a86fee7e3846ad3c4bc564cac6264.tar.gz |
Don't complain about files that can't be parsed as Python if they didn't seem like Python at all. #82.
Diffstat (limited to 'coverage/report.py')
-rw-r--r-- | coverage/report.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/coverage/report.py b/coverage/report.py index 6c5510ad..5d187996 100644 --- a/coverage/report.py +++ b/coverage/report.py @@ -84,6 +84,11 @@ class Reporter(object): for cu in self.code_units: try: report_fn(cu, self.coverage._analyze(cu)) - except (NoSource, NotPython): + except NoSource: if not self.ignore_errors: raise + except NotPython: + # Only report errors for .py files, and only if we didn't + # explicitly suppress those errors. + if cu.should_be_python(".py") and not self.ignore_errors: + raise |