From 4a2e97025e293c898eba2898a86b712cfe7a378a Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 9 Dec 2012 21:35:59 -0500 Subject: Hmm, is this a good way to keep the meta-coverage quiet? --- coverage/control.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 309343b7..115d26c3 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -181,6 +181,7 @@ class coverage(object): # Is it ok for no data to be collected? self._warn_no_data = True + self._warn_unimported_source = True self._started = False atexit.register(self._atexit) @@ -481,8 +482,9 @@ class coverage(object): # If there are still entries in the source_pkgs list, then we never # encountered those packages. - for pkg in self.source_pkgs: - self._warn("Module %s was never imported." % pkg) + if self._warn_unimported_source: + for pkg in self.source_pkgs: + self._warn("Module %s was never imported." % pkg) # Find out if we got any data. summary = self.data.summary() @@ -706,6 +708,7 @@ def process_startup(): cov = coverage(config_file=cps, auto_data=True) cov.start() cov._warn_no_data = False + cov._warn_unimported_source = False # A hack for debugging testing in subprocesses. -- cgit v1.2.1