MCPcopy Create free account
hub / github.com/tox-dev/filelock / _tracemalloc_lookup_without_support

Function _tracemalloc_lookup_without_support

tests/conftest.py:35–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33
34@pytest.fixture(autouse=True, scope="session")
35def _tracemalloc_lookup_without_support() -> Iterator[None]:
36 # pytest's thread and unraisable exception hooks ask tracemalloc where the offending object was allocated. Where
37 # that lookup raises (GraalPy), the hook reports "Failed to process thread exception" in place of the thread's real
38 # error, so hand it the answer tracemalloc gives while it is not tracing.
39 with pytest.MonkeyPatch.context() as patch:
40 if not CAPABILITIES["tracemalloc-object-traceback"]: # pragma: lacks tracemalloc-object-traceback
41 patch.setattr("tracemalloc.get_object_traceback", lambda _source: None)
42 yield
43
44
45@pytest.fixture(autouse=True)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected