diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2017-03-04 05:49:16 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2017-03-04 05:49:16 -0500 |
commit | a34ef56b8b1bd57be1d70b0fc268b8ed76bad8e1 (patch) | |
tree | 74d5832f910b03003037cb79f81ba007082a7385 /coverage/control.py | |
parent | c37be77ec5934510585bf4a44a89e8673fe61c46 (diff) | |
download | python-coveragepy-a34ef56b8b1bd57be1d70b0fc268b8ed76bad8e1.tar.gz |
Slightly better way to organize the condition on activity
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/coverage/control.py b/coverage/control.py index a12eb2e..40c2266 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -797,11 +797,18 @@ class Coverage(object): """ self._init() - if not self.collector.activity(): - return self.data + if self.collector.save_data(self.data): + self._post_save_work() - self.collector.save_data(self.data) + return self.data + + def _post_save_work(self): + """After saving data, look for warnings, post-work, etc. + + Warn about things that should have happened but didn't. + Look for unexecuted files. + """ # If there are still entries in the source_pkgs_unmatched list, # then we never encountered those packages. if self._warn_unimported_source: @@ -835,8 +842,6 @@ class Coverage(object): if self.config.note: self.data.add_run_info(note=self.config.note) - return self.data - def _find_unexecuted_files(self, src_dir): """Find unexecuted files in `src_dir`. |