diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-02-06 17:42:53 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-02-06 17:43:26 -0500 |
commit | 7e85e782bc24fa487d77aff3356eaf04db764d21 (patch) | |
tree | d238edc7245c83ae73c2d3482507bf8423ad3710 /coverage/control.py | |
parent | 7bd23c8ae4f219136332501ecd1767ed16ceb559 (diff) | |
download | python-coveragepy-git-7e85e782bc24fa487d77aff3356eaf04db764d21.tar.gz |
debug: pybehave is now an option on `coverage debug`
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/coverage/control.py b/coverage/control.py index a3fda8d8..0f9f675e 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -29,7 +29,7 @@ from coverage.html import HtmlReporter from coverage.inorout import InOrOut from coverage.jsonreport import JsonReporter from coverage.lcovreport import LcovReporter -from coverage.misc import bool_or_none, join_regex, human_sorted, human_sorted_items +from coverage.misc import bool_or_none, join_regex, human_sorted from coverage.misc import DefaultValue, ensure_dir_for_file, isolate_module from coverage.plugin import FileReporter from coverage.plugin_support import Plugins @@ -315,35 +315,25 @@ class Coverage: """Write out debug info at startup if needed.""" wrote_any = False with self._debug.without_callers(): - if self._debug.should('config'): - config_info = human_sorted_items(self.config.__dict__.items()) - config_info = [(k, v) for k, v in config_info if not k.startswith('_')] - write_formatted_info(self._debug, "config", config_info) + if self._debug.should("config"): + config_info = self.config.debug_info() + write_formatted_info(self._debug.write, "config", config_info) wrote_any = True - if self._debug.should('sys'): - write_formatted_info(self._debug, "sys", self.sys_info()) + if self._debug.should("sys"): + write_formatted_info(self._debug.write, "sys", self.sys_info()) for plugin in self._plugins: header = "sys: " + plugin._coverage_plugin_name info = plugin.sys_info() - write_formatted_info(self._debug, header, info) + write_formatted_info(self._debug.write, header, info) wrote_any = True - if self._debug.should('pybehave'): - info = [ - (name, value) for name, value in env.__dict__.items() - if not name.startswith("_") and - name != "PYBEHAVIOR" and - not isinstance(value, type(os)) - ] + [ - (name, value) for name, value in env.PYBEHAVIOR.__dict__.items() - if not name.startswith("_") - ] - write_formatted_info(self._debug, "pybehave", sorted(info)) + if self._debug.should("pybehave"): + write_formatted_info(self._debug.write, "pybehave", env.debug_info()) wrote_any = True if wrote_any: - write_formatted_info(self._debug, "end", ()) + write_formatted_info(self._debug.write, "end", ()) def _should_trace(self, filename, frame): """Decide whether to trace execution in `filename`. |