Skip to content
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

Weekly cleanups #4417

Merged
merged 2 commits into from
Mar 11, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,17 @@ default_cwarnflags()

default_pytest()
{
PYTEST_BINS="pytest py.test pytest3 pytest-3"
# Since we just checked that we have python3 we give that one the
# most priority and then fall back to some common aliases.
PYTEST_BINS="python3 -m pytest,pytest,py.test,pytest3,pytest-3"
IFS=','
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to revert/unset IFS after this?

for p in $PYTEST_BINS; do
if [ "$(which $p)" != "" ] ; then
"$p" --version 2>&1 | grep -q "python3" || continue
# If it is a combined command such as `python3 -m pytest` we
# want to only call which on the executable
exe=$(echo "$p" | awk '{print $1}')
# shellcheck disable=SC2086
if [ "$(which $exe)" != "" ] ; then
"$p" --version 2>&1 | grep -q "pytest" || continue
echo "$p"
return
fi
Expand Down