-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Run pytest for src tree if no filename is given #35999
Conversation
|
Adding |
Explicitly limiting tests to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM.
Tobias's suggestion to have pytest ignore local
(and I think also venv
) is a good idea too, but it's already a good fix as is.
Thanks! |
Documentation preview for this PR (built with commit e17f1de; changes) is ready! 🎉 |
This fixes the failure seen, for example,
https://github.com/sagemath/sage/actions/runs/5678761729/job/15389749593?pr=35991
Note that the last failure message
This is not a fault of matplotlib! The fault lies on our pytest, which blindly runs all tests found in the directory tree under the root dir. (matplotlib test files are supposed to run in a development install, where the baseline image directory exists, but our install (SPKG) of matplotlib is not a development install, and hence there's no baseline image directory.)
So we need to stop pytest from running blind. The failure in the incremental test workflow results from an error in
sage-runtests
. The relevant lines areLook at the faulty line. The condition test allows pytest run without explicit filenames. This results in running pytest for all test files found under the (sage) root dir. Hence pytest attempts to run tests in matplotlib in
local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/matplotlib/tests
.The branch of this PR fixes the problem.
📝 Checklist
⌛ Dependencies