Commit 9d32d53
committed
Use sys.monitoring for small speedup of tests in Python 3.12+
This adds a pytest flag to `pyproject.toml` to use sys.monitoring if it
is available. This can speed up `coverage.py`. The reason is that
`sys.monitoring` (introduced in Python 3.12 via PEP 669) offers a more
efficient way to monitor program execution, potentially leading to
faster coverage measurement, especially for line coverage. This feature
is only available for Python 3.12+, but it can be turned on always and
warnings about _not_ having the sysmon feature can be ignored. Example
of a project that found it useful:
https://blog.trailofbits.com/2025/05/01/making-pypis-test-suite-81-faster/1 parent a4d0bf2 commit 9d32d53
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments