diff options
author | wonwinmcbrootles@Wonwin-McBrootles-Computer.local <wonwinmcbrootles@Wonwin-McBrootles-Computer.local> | 2010-05-09 22:25:41 -0600 |
---|---|---|
committer | wonwinmcbrootles@Wonwin-McBrootles-Computer.local <wonwinmcbrootles@Wonwin-McBrootles-Computer.local> | 2010-05-09 22:25:41 -0600 |
commit | bc92b67f11207ffdaff085661cda0118f13a6656 (patch) | |
tree | ffcf824be4fca875b503a06a19b22a80785cc337 /coverage/xmlreport.py | |
parent | 3fa1d99066ecbbd02b15885b18c6e99385733954 (diff) | |
download | python-coveragepy-bc92b67f11207ffdaff085661cda0118f13a6656.tar.gz |
fix a couple of bugs in control.py such that handling of omit_prefixes and/or require_prefixes was wrong
update cmdline tests so they don't go red due to an unexpected constructor argument 'require_prefixes'
note that there is not a real test of the "--require" cmdline argument -- I just added "require_prefixes=None" to the tests, so there is not test which tests what happens when someone passes --require= to the summary commands, much less to the run command.
Diffstat (limited to 'coverage/xmlreport.py')
-rw-r--r-- | coverage/xmlreport.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/coverage/xmlreport.py b/coverage/xmlreport.py index ab44025..4f91b1b 100644 --- a/coverage/xmlreport.py +++ b/coverage/xmlreport.py @@ -22,12 +22,17 @@ class XmlReporter(Reporter): self.xml_out = None self.arcs = coverage.data.has_arcs() - def report(self, morfs, omit_prefixes=None, outfile=None): + def report(self, morfs, omit_prefixes=None, require_prefixes=None, outfile=None): """Generate a Cobertura-compatible XML report for `morfs`. `morfs` is a list of modules or filenames. `omit_prefixes` is a list of strings, prefixes of modules to omit from the report. + `omit_prefixes` is a list of prefixes. CodeUnits that match those prefixes + will be omitted from the list. + `require_prefixes` is a list of prefixes. Only CodeUnits that match those prefixes + will be included in the list. + You are required to pass at most one of `omit_prefixes` and `require_prefixes`. """ # Initial setup. outfile = outfile or sys.stdout @@ -52,7 +57,7 @@ class XmlReporter(Reporter): # Call xml_file for each file in the data. self.packages = {} - self.report_files(self.xml_file, morfs, omit_prefixes=omit_prefixes) + self.report_files(self.xml_file, morfs, omit_prefixes=omit_prefixes, require_prefixes=require_prefixes) lnum_tot, lhits_tot = 0, 0 bnum_tot, bhits_tot = 0, 0 |