summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-10-26 16:08:29 -0400
committerNed Batchelder <ned@nedbatchelder.com>2014-10-26 16:08:29 -0400
commit48e5456376c0937b47df99862f2c4ab29fea599c (patch)
tree82d76ba1850e073a4b0437b5ced53e12095878ff /coverage/control.py
parent9b8e67fe48ca5d9d1d6e1a7f03eac625388cc7c7 (diff)
downloadpython-coveragepy-git-48e5456376c0937b47df99862f2c4ab29fea599c.tar.gz
Allow the --debug switch on any command
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 66979c33..4c087655 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -262,6 +262,29 @@ class Coverage(object):
self._inited = True
+ # Create the matchers we need for _should_trace
+ if self.source or self.source_pkgs:
+ self.source_match = TreeMatcher(self.source)
+ else:
+ if self.cover_dir:
+ self.cover_match = TreeMatcher([self.cover_dir])
+ if self.pylib_dirs:
+ self.pylib_match = TreeMatcher(self.pylib_dirs)
+ if self.include:
+ self.include_match = FnmatchMatcher(self.include)
+ if self.omit:
+ self.omit_match = FnmatchMatcher(self.omit)
+
+ # The user may want to debug things, show info if desired.
+ if self.debug.should('config'):
+ self.debug.write("Configuration values:")
+ config_info = sorted(self.config.__dict__.items())
+ self.debug.write_formatted_info(config_info)
+
+ if self.debug.should('sys'):
+ self.debug.write("Debugging info:")
+ self.debug.write_formatted_info(self.sysinfo())
+
def _canonical_dir(self, morf):
"""Return the canonical directory of the module or file `morf`."""
morf_filename = PythonCodeUnit(morf, self.file_locator).filename
@@ -495,29 +518,6 @@ class Coverage(object):
if self._auto_data:
self.load()
- # Create the matchers we need for _should_trace
- if self.source or self.source_pkgs:
- self.source_match = TreeMatcher(self.source)
- else:
- if self.cover_dir:
- self.cover_match = TreeMatcher([self.cover_dir])
- if self.pylib_dirs:
- self.pylib_match = TreeMatcher(self.pylib_dirs)
- if self.include:
- self.include_match = FnmatchMatcher(self.include)
- if self.omit:
- self.omit_match = FnmatchMatcher(self.omit)
-
- # The user may want to debug things, show info if desired.
- if self.debug.should('config'):
- self.debug.write("Configuration values:")
- config_info = sorted(self.config.__dict__.items())
- self.debug.write_formatted_info(config_info)
-
- if self.debug.should('sys'):
- self.debug.write("Debugging info:")
- self.debug.write_formatted_info(self.sysinfo())
-
self.collector.start()
self._started = True
self._measured = True