mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: Fix configure to find pytest when installed using pip3.
Installing pytest through pip3 (at least sometimes) doesn't create a script. This means calling `which` won't work. Changed configure so that it can also test if the module is present by calling python/python3. Change the error message for when pytest can't be found, so that it's clear to the user `configure` must be ran again after installing pytest.
This commit is contained in:
committed by
Rusty Russell
parent
cefb6925b2
commit
b52fb14726
2
Makefile
2
Makefile
@@ -216,7 +216,7 @@ check:
|
|||||||
|
|
||||||
pytest: $(ALL_PROGRAMS)
|
pytest: $(ALL_PROGRAMS)
|
||||||
ifndef PYTEST
|
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
|
exit 1
|
||||||
else
|
else
|
||||||
# Explicitly hand DEVELOPER and VALGRIND so you can override on make cmd line.
|
# Explicitly hand DEVELOPER and VALGRIND so you can override on make cmd line.
|
||||||
|
|||||||
11
configure
vendored
11
configure
vendored
@@ -71,6 +71,17 @@ find_pytest()
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
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`}
|
PYTEST=${PYTEST:-`find_pytest`}
|
||||||
|
|||||||
Reference in New Issue
Block a user