Coverage.py with sys.monitoring
Briefly

New in Python 3.12 is sys.monitoring, a lighter-weight way to monitor the execution of Python programs.
Using sys.monitoring should reduce the overhead of coverage measurement, often lower than 5%, but of course your timings might be different.
Some things won't work with sys.monitoring: plugins and dynamic contexts aren't yet supported, though eventually they will be. Execution will be faster for line coverage, but not yet for branch coverage.
This has been in the works since at least March. I hope I haven't forgotten something silly in getting it out the door.
Read at Nedbatchelder
[
]
[
|
]