summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-12-29 19:00:48 -0500
committerNed Batchelder <ned@nedbatchelder.com>2019-12-29 19:00:48 -0500
commit7fde808f6f1134263a72622ef6153fe9e5a6cf7b (patch)
tree6012c19afb78cd74c06c4a1c0902e71fa6998f49
parent129e5616783a1a12fb08fe42f0c0c478e5177da2 (diff)
downloadpython-coveragepy-git-7fde808f6f1134263a72622ef6153fe9e5a6cf7b.tar.gz
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.
-rw-r--r--coverage/control.py11
1 files changed, 7 insertions, 4 deletions
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):