()
| 189 | |
| 190 | |
| 191 | def 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", |
nothing calls this directly
no test coverage detected
searching dependent graphs…