From 7e85e782bc24fa487d77aff3356eaf04db764d21 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 6 Feb 2022 17:42:53 -0500 Subject: debug: pybehave is now an option on `coverage debug` --- coverage/env.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'coverage/env.py') diff --git a/coverage/env.py b/coverage/env.py index 3b24c390..1922d93f 100644 --- a/coverage/env.py +++ b/coverage/env.py @@ -133,3 +133,17 @@ USE_CONTRACTS = ( and not bool(int(os.environ.get("COVERAGE_NO_CONTRACTS", 0))) and (PYVERSION < (3, 11)) ) + +def debug_info(): + """Return a list of (name, value) pairs for printing debug information.""" + info = [ + (name, value) for name, value in globals().items() + if not name.startswith("_") and + name not in {"PYBEHAVIOR", "debug_info"} and + not isinstance(value, type(os)) + ] + info += [ + (name, value) for name, value in PYBEHAVIOR.__dict__.items() + if not name.startswith("_") + ] + return sorted(info) -- cgit v1.2.1