summaryrefslogtreecommitdiff
path: root/coverage/debug.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/debug.py')
-rw-r--r--coverage/debug.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/coverage/debug.py b/coverage/debug.py
index c2d7b517..f990ca3b 100644
--- a/coverage/debug.py
+++ b/coverage/debug.py
@@ -352,40 +352,3 @@ def _clean_stack_line(s): # pragma: debugging
s = s.replace(os.path.dirname(os.__file__) + '/', '')
s = s.replace(sys.prefix + '/', '')
return s
-
-
-def filter_aspectlib_frames(text): # pragma: debugging
- """Aspectlib prints stack traces, but includes its own frames. Scrub those out."""
- # <<< aspectlib/__init__.py:257:function_wrapper < igor.py:143:run_tests < ...
- text = re.sub(r"(?<= )aspectlib/[^.]+\.py:\d+:\w+ < ", "", text)
- return text
-
-
-def enable_aspectlib_maybe(): # pragma: debugging
- """For debugging, we can use aspectlib to trace execution.
-
- Define COVERAGE_ASPECTLIB to enable and configure aspectlib to trace
- execution::
-
- $ export COVERAGE_ASPECTLIB=coverage.Coverage:coverage.data.CoverageData
- $ coverage run blah.py ...
-
- This will trace all the public methods on Coverage and CoverageData,
- writing the information to covaspect.txt.
-
- """
- aspects = os.environ.get("COVERAGE_ASPECTLIB", "")
- if not aspects:
- return
-
- import aspectlib # pylint: disable=import-error
- import aspectlib.debug # pylint: disable=import-error
-
- filters = [add_pid_and_tid, filter_aspectlib_frames]
- aspects_file = DebugOutputFile.get_one(None, show_process=True, filters=filters)
- aspect_log = aspectlib.debug.log(
- print_to=aspects_file, attributes=['id'], stacktrace=30, use_logging=False
- )
- public_methods = re.compile(r'^(__init__|[a-zA-Z].*)$')
- for aspect in aspects.split(':'):
- aspectlib.weave(aspect, aspect_log, methods=public_methods)