Commit f0e30b9
authored
Use sys.monitoring for small speedup of tests in Python 3.12+ (#1220)
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.
The same change was applied in Cirq recently and it has been beneficial
there.1 parent 2bf478a commit f0e30b9
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