diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-09 21:35:59 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-09 21:35:59 -0500 |
commit | 4a2e97025e293c898eba2898a86b712cfe7a378a (patch) | |
tree | ce1b3b9b5a4a6c9a94dd1dfdaa73f3ade467b8b9 /coverage/control.py | |
parent | 82f69c9df4763c1f820d7b8fa4d68f13ce59b793 (diff) | |
download | python-coveragepy-git-4a2e97025e293c898eba2898a86b712cfe7a378a.tar.gz |
Hmm, is this a good way to keep the meta-coverage quiet?
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 7 |
1 files changed, 5 insertions, 2 deletions
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. |