From 92db04203fbf4d58e64d262123f9e4b5bc6b7da7 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 25 Sep 2016 09:47:08 -0400 Subject: A better way to prevent call stacks during multi-line output --- coverage/control.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 3464d66..351992f 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -366,18 +366,19 @@ class Coverage(object): # The user may want to debug things, show info if desired. wrote_any = False - if self.debug.should('config'): - config_info = sorted(self.config.__dict__.items()) - self.debug.write_formatted_info("config", config_info) - wrote_any = True - - if self.debug.should('sys'): - self.debug.write_formatted_info("sys", self.sys_info()) - for plugin in self.plugins: - header = "sys: " + plugin._coverage_plugin_name - info = plugin.sys_info() - self.debug.write_formatted_info(header, info) - wrote_any = True + with self.debug.without_callers(): + if self.debug.should('config'): + config_info = sorted(self.config.__dict__.items()) + self.debug.write_formatted_info("config", config_info) + wrote_any = True + + if self.debug.should('sys'): + self.debug.write_formatted_info("sys", self.sys_info()) + for plugin in self.plugins: + header = "sys: " + plugin._coverage_plugin_name + info = plugin.sys_info() + self.debug.write_formatted_info(header, info) + wrote_any = True if wrote_any: self.debug.write_formatted_info("end", ()) -- cgit v1.2.1