diff --git a/Makefile b/Makefile index 71ae936a0..4ad9274a2 100644 --- a/Makefile +++ b/Makefile @@ -216,7 +216,7 @@ check: pytest: $(ALL_PROGRAMS) ifndef PYTEST - @echo "py.test is required to run the integration tests, please install using 'pip3 install -r tests/requirements.txt'" + @echo "py.test is required to run the integration tests, please install using 'pip3 install -r tests/requirements.txt', and rerun 'configure'." exit 1 else # Explicitly hand DEVELOPER and VALGRIND so you can override on make cmd line. diff --git a/configure b/configure index 3e6739fcc..eb43b59bf 100755 --- a/configure +++ b/configure @@ -71,6 +71,17 @@ find_pytest() return fi done + + PYTHON_BINS="python python3" + for p in $PYTHON_BINS; do + if [ "$(which $p)" != "" ] ; then + $p --version 2>&1 | grep -q "Python 3." || continue + if $p -c "import pytest" ; then + echo "$p -m pytest" + return + fi + fi + done } PYTEST=${PYTEST:-`find_pytest`}