From c2b6a46547f05dd7b89c1a8484c10cd02c34e542 Mon Sep 17 00:00:00 2001 From: "wonwinmcbrootles@Wonwin-McBrootles-Computer.local" Date: Sun, 9 May 2010 22:25:41 -0600 Subject: 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. --HG-- extra : transplant_source : %F7%B3%26E%27Va%A2W4%9EX%9F%02oV%3C%A2%27%E1 --- coverage/xmlreport.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'coverage/xmlreport.py') diff --git a/coverage/xmlreport.py b/coverage/xmlreport.py index ab44025d..4f91b1b6 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 -- cgit v1.2.1