MCPcopy Index your code
hub / github.com/python/cpython / requires_strace

Function requires_strace

Lib/test/support/strace_helper.py:191–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

189
190
191def requires_strace():
192 if sys.platform != "linux":
193 return unittest.skip("Linux only, requires strace.")
194
195 if "LD_PRELOAD" in os.environ:
196 # Distribution packaging (ex. Debian `fakeroot` and Gentoo `sandbox`)
197 # use LD_PRELOAD to intercept system calls, which changes the overall
198 # set of system calls which breaks tests expecting a specific set of
199 # system calls).
200 return unittest.skip("Not supported when LD_PRELOAD is intercepting system calls.")
201
202 if support.check_sanitizer(address=True, memory=True):
203 return unittest.skip("LeakSanitizer does not work under ptrace (strace, gdb, etc)")
204
205 return unittest.skipUnless(_can_strace(), "Requires working strace")
206
207
208__all__ = ["filter_memory", "get_events", "get_syscalls", "requires_strace",

Callers

nothing calls this directly

Calls 2

_can_straceFunction · 0.85
skipMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…