Commit 4c97ec0
committed
fix(tests): skip pyinstrument profiling for benchmark tests
pyinstrument 5.1.2 uses a C-level ProfilerState object via sys.setprofile() that is not a callable Python function. pytest-benchmark's PauseInstrumentation saves and restores the profiler via sys.setprofile(), which fails with TypeError on the non-callable ProfilerState.
Skip the auto_profile fixture for tests using the benchmark fixture, since profiling during benchmarks is counterproductive anyway (adds overhead that corrupts measurements).1 parent 824e343 commit 4c97ec0
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
| |||
0 commit comments