MCPcopy Create free account
hub / github.com/pytest-dev/pytest / restore_tracing

Function restore_tracing

testing/conftest.py:12–20  ·  view source on GitHub ↗

Restore tracing function (when run with Coverage.py). https://bugs.python.org/issue37011

()

Source from the content-addressed store, hash-verified

10
11 @pytest.fixture(autouse=True)
12 def restore_tracing():
13 """Restore tracing function (when run with Coverage.py).
14
15 https://bugs.python.org/issue37011
16 """
17 orig_trace = sys.gettrace()
18 yield
19 if sys.gettrace() != orig_trace:
20 sys.settrace(orig_trace)
21
22
23@pytest.hookimpl(hookwrapper=True, tryfirst=True)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected