summaryrefslogtreecommitdiff
path: root/coverage/report.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-05-23 16:09:44 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-05-23 16:09:44 -0400
commit039345d5c311d5d55ee6c93554959fd5685a862c (patch)
treef11ae9cf490e2550d8d8072de6a1ac0bf72549d8 /coverage/report.py
parent762d67689a8ddc88195cdbb0787bc3e940ddbf85 (diff)
downloadpython-coveragepy-git-039345d5c311d5d55ee6c93554959fd5685a862c.tar.gz
Omit and include are now filename patterns rather than prefixes. BACKWARD INCOMPATIBLE change.
Diffstat (limited to 'coverage/report.py')
-rw-r--r--coverage/report.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/coverage/report.py b/coverage/report.py
index a676e186..f7662a31 100644
--- a/coverage/report.py
+++ b/coverage/report.py
@@ -24,34 +24,32 @@ class Reporter(object):
# classes.
self.directory = None
- def find_code_units(self, morfs, omit_prefixes, include_prefixes):
+ def find_code_units(self, morfs, omit, include):
"""Find the code units we'll report on.
- `morfs` is a list of modules or filenames. `omit_prefixes` is a list
- of prefixes to leave out of the list.
+ `morfs` is a list of modules or filenames.
See `coverage.report()` for other arguments.
"""
morfs = morfs or self.coverage.data.executed_files()
self.code_units = code_unit_factory(
- morfs, self.coverage.file_locator, omit_prefixes,
- include_prefixes
+ morfs, self.coverage.file_locator, omit, include
)
self.code_units.sort()
def report_files(self, report_fn, morfs, directory=None,
- omit_prefixes=None, include_prefixes=None):
+ omit=None, include=None):
"""Run a reporting function on a number of morfs.
`report_fn` is called for each relative morf in `morfs`.
- `include_prefixes` is a list of filename prefixes. CodeUnits that match
- those prefixes will be included in the list. CodeUnits that match
- `omit_prefixes` will be omitted from the list.
+ `include` is a list of filename patterns. CodeUnits that match
+ those patterns will be included in the list. CodeUnits that match
+ `omit` will be omitted from the list.
"""
- self.find_code_units(morfs, omit_prefixes, include_prefixes)
+ self.find_code_units(morfs, omit, include)
if not self.code_units:
raise CoverageException("No data to report.")