You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Python 3.14 will now allow me to use sys.monitoring for branch coverage, the last obstacle (for me!) remains this package.
I've found a decent workaround: marking every test that renders a template that I want to get coverage on and then running those without the environment variable, separately from the others, and combining the coverage files from the two test runs. Given the timings from my experimentation, this seems well worth the effort.
So this is really just a question: is there anything that can be done in this package or in Coverage.py (or I suppose, in my project) that can work around this in a more general way, without me needing to make this somewhat painstaking change to my codebase?
I just ran into this as well trying to upgrade to Python 3.14 and getting lower coverage (all templates are uncovered). It looks like the default core (trace function implementation) is not ctrace but sysmon on Python 3.14. I could not find this in the release notes and the documentation states that ctrace is the default.
Activity
nedbat commentedon May 27, 2025
We need to support plugins with the sys.monitoring core, as requested here: coveragepy/coveragepy#1790
mschoettle commentedon Oct 16, 2025
I just ran into this as well trying to upgrade to Python 3.14 and getting lower coverage (all templates are uncovered). It looks like the default core (trace function implementation) is not
ctracebutsysmonon Python 3.14. I could not find this in the release notes and the documentation states thatctraceis the default.Docs PR raised here: coveragepy/coveragepy#2067