-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TST: coverage overhead mostly goes away in Python >= 3.12 #15975
Comments
(this isn't a feature request, that label just came from using the feature request issue template, when I should have used free form) |
It is up to you what template you want to use. I updated the labels. Thanks for the heads up! |
I don't think we pull in coverage directly. Is it what pytest-cov uses? |
yes it is. |
Is this limitation still true? We use plugins. 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. Let me know how it works for you. |
What plugins do we use ? I couldn't find any. |
I am not sure what counts as dynamic context either. |
No, he means coverage plugins. Pytest and coverage are completely independent tools, we just happen to run the latter through an extension to the former ( |
I'm assuming he means context managers or something related. I will look it up and ask him for clarification if I'm not confident I get it. |
So actually it means something else specifically in |
coverage.py
is moving to a much more lightweight profiling method, available in Python 3.12 and which current release ofcoverage.py
have an opt-in option for. It'll be the default behaviour sometimes in the future.I've ran astropy's test suite locally to get a sense of the improvements:
This is so much better that I think it would make sense to just have coverage on all the time instead of having dedicated jobs in
tox.ini
and in CI. However this is not happening before there's at least a nicer interface to use this new method (currently it's controlled by an environment variable and coverage doesn't gracefully fallback in currently-unsupported cases), and even then it'll only apply to Python >= 3.12, so this issue is to serve as a reminder of it when the time comes.xref: blogpost on this topic by the package author https://nedbatchelder.com/blog/202312/coveragepy_with_sysmonitoring.html
The text was updated successfully, but these errors were encountered: