52 Returns a list of FileReporters. |
52 Returns a list of FileReporters. |
53 |
53 |
54 """ |
54 """ |
55 reporters = self.coverage._get_file_reporters(morfs) |
55 reporters = self.coverage._get_file_reporters(morfs) |
56 |
56 |
57 if self.config.include: |
57 if self.config.report_include: |
58 matcher = FnmatchMatcher(prep_patterns(self.config.include)) |
58 matcher = FnmatchMatcher(prep_patterns(self.config.report_include)) |
59 reporters = [fr for fr in reporters if matcher.match(fr.filename)] |
59 reporters = [fr for fr in reporters if matcher.match(fr.filename)] |
60 |
60 |
61 if self.config.omit: |
61 if self.config.report_omit: |
62 matcher = FnmatchMatcher(prep_patterns(self.config.omit)) |
62 matcher = FnmatchMatcher(prep_patterns(self.config.report_omit)) |
63 reporters = [fr for fr in reporters if not matcher.match(fr.filename)] |
63 reporters = [fr for fr in reporters if not matcher.match(fr.filename)] |
64 |
64 |
65 self._file_reporters = sorted(reporters) |
65 self._file_reporters = sorted(reporters) |
66 return self._file_reporters |
66 return self._file_reporters |
67 |
67 |
95 except NotPython: |
95 except NotPython: |
96 # Only report errors for .py files, and only if we didn't |
96 # Only report errors for .py files, and only if we didn't |
97 # explicitly suppress those errors. |
97 # explicitly suppress those errors. |
98 # NotPython is only raised by PythonFileReporter, which has a |
98 # NotPython is only raised by PythonFileReporter, which has a |
99 # should_be_python() method. |
99 # should_be_python() method. |
100 if fr.should_be_python() and not self.config.ignore_errors: |
100 if fr.should_be_python(): |
101 raise |
101 if self.config.ignore_errors: |
|
102 self.coverage._warn("Could not parse Python file {0}".format(fr.filename)) |
|
103 else: |
|
104 raise |