From 7fde808f6f1134263a72622ef6153fe9e5a6cf7b Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 29 Dec 2019 19:00:48 -0500 Subject: Write debug info after initting for start. A few important and confusing things are only created in _init_for_start, and without resetting the write-debug-info flag, we never see them in the debug output. This makes the info appear more than once, but at least we get what we need. --- coverage/control.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 889ef55c..3a0b0107 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -224,8 +224,8 @@ class Coverage(object): self._inited_for_start = False # Have we started collecting and not stopped it? self._started = False - # Have we written --debug output? - self._wrote_debug = False + # Should we write the debug output? + self._should_write_debug = True # If we have sub-process measurement happening automatically, then we # want any explicit creation of a Coverage object to mean, this process @@ -277,8 +277,8 @@ class Coverage(object): def _post_init(self): """Stuff to do after everything is initialized.""" - if not self._wrote_debug: - self._wrote_debug = True + if self._should_write_debug: + self._should_write_debug = False self._write_startup_debug() # '[run] _crash' will raise an exception if the value is close by in @@ -481,6 +481,9 @@ class Coverage(object): self._inorout.plugins = self._plugins self._inorout.disp_class = self._collector.file_disposition_class + # It's useful to write debug info after initing for start. + self._should_write_debug = True + atexit.register(self._atexit) def _init_data(self, suffix): -- cgit v1.2.1