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/control.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index a337d6bd..2c774ae6 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -102,8 +102,12 @@ class coverage(object): if self.config.omit_prefixes: self.omit_prefixes = [self.file_locator.abs_file(p) for p in self.config.omit_prefixes] + else: + self.omit_prefixes = [] if self.config.require_prefixes: self.require_prefixes = [self.file_locator.abs_file(p) for p in self.config.require_prefixes] + else: + self.require_prefixes = [] self.collector = Collector( self._should_trace, timid=self.config.timid, @@ -192,12 +196,9 @@ class coverage(object): return canonical else: return False - elif omit_prefixes: - for prefix in prefixes: - if canonical.startswith(prefix): - return False - - code_units = filtered + for prefix in self.omit_prefixes: + if canonical.startswith(prefix): + return False return canonical -- cgit v1.2.1