-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
build-style/python3-module: prefer pytest in do_check #26901
Conversation
IIRC there are a couple templates that call |
How about tox as well? We could go Never mind, I forgot #25052 |
if python3 -m pytest --help >/dev/null 2>&1; then | ||
python3 -m pytest ${make_check_args} ${make_check_target} | ||
else |
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.
I'm not against leaving a historical comment like "we don't try to use tox because ...."
msg_warn "No command 'test' defined by setup.py.\n" | ||
return 0 | ||
if python3 -m pytest --help >/dev/null 2>&1; then | ||
python3 -m pytest ${make_check_args} ${make_check_target} |
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.
Not sure if this is better:
PYTHONPATH="$(cd build/lib* && pwd)" python3 -m pytest ${make_check_args} ${make_check_target}
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.
Setting PYTHONPATH
this way might improve support for testing compiled extensions, but I'm not sure it should be the default. If tests break because they can't be run with the default path (plus .
, which is automatically added in the python3 -m pytest
form of invocation), maybe that should be a manual override situation.
Closed in a3227ff |
Closes #25052.