diff options
Diffstat (limited to 'coverage')
-rw-r--r-- | coverage/plugin.py | 9 | ||||
-rw-r--r-- | coverage/plugin_support.py | 5 | ||||
-rw-r--r-- | coverage/report.py | 2 | ||||
-rw-r--r-- | coverage/summary.py | 2 |
4 files changed, 4 insertions, 14 deletions
diff --git a/coverage/plugin.py b/coverage/plugin.py index 8cd6dd3f..c569d26d 100644 --- a/coverage/plugin.py +++ b/coverage/plugin.py @@ -214,12 +214,3 @@ class FileReporter(object): # A generic implementation, each line is one "txt" token. for line in self.source().splitlines(): yield [('txt', line)] - - def should_be_python(self): - """Does it seem like this file should contain Python? - - This is used to decide if a file reported as part of the execution of - a program was really likely to have contained Python in the first - place. - """ - return False diff --git a/coverage/plugin_support.py b/coverage/plugin_support.py index 23c1bc1a..92246d46 100644 --- a/coverage/plugin_support.py +++ b/coverage/plugin_support.py @@ -242,8 +242,3 @@ class DebugFileReporterWrapper(FileReporter): ret = list(self.reporter.source_token_lines()) self.debug.write("source_token_lines() --> %d tokens" % (len(ret),)) return ret - - def should_be_python(self): - ret = self.reporter.should_be_python() - self.debug.write("should_be_python() --> %r" % (ret,)) - return ret diff --git a/coverage/report.py b/coverage/report.py index fa081862..1be4155d 100644 --- a/coverage/report.py +++ b/coverage/report.py @@ -87,5 +87,7 @@ class Reporter(object): except NotPython: # Only report errors for .py files, and only if we didn't # 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 diff --git a/coverage/summary.py b/coverage/summary.py index 03270c04..7eb0f2fc 100644 --- a/coverage/summary.py +++ b/coverage/summary.py @@ -87,6 +87,8 @@ class SummaryReporter(Reporter): report_it = not self.config.ignore_errors if report_it: typ, msg = sys.exc_info()[:2] + # NotPython is only raised by PythonFileReporter, which has a + # should_be_python() method. if typ is NotPython and not fr.should_be_python(): report_it = False if report_it: |