From f43722b1bcb1cdc46bfe42f850fedb6903e90396 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 4 Mar 2017 05:49:16 -0500 Subject: Slightly better way to organize the condition on activity --- coverage/control.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index a12eb2ee..40c22667 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`. -- cgit v1.2.1