mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 21:25:13 +00:00
use a more conservative mechanism to check for pytest
On a debian jessie machine, running 'python --version --noconftest' caused pytest to try and run the test suite with the not-yet-compiled extension module, thus failing the test. This commit chages the pytest detection so that it only attempts to run an import statement.
This commit is contained in:
parent
5f07facef5
commit
0e49c02213
@ -88,7 +88,7 @@ endif()
|
|||||||
|
|
||||||
# Make sure pytest is found or produce a fatal error
|
# Make sure pytest is found or produce a fatal error
|
||||||
if(NOT PYBIND11_PYTEST_FOUND)
|
if(NOT PYBIND11_PYTEST_FOUND)
|
||||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pytest --version --noconftest OUTPUT_QUIET ERROR_QUIET
|
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import pytest" OUTPUT_QUIET ERROR_QUIET
|
||||||
RESULT_VARIABLE PYBIND11_EXEC_PYTHON_ERR)
|
RESULT_VARIABLE PYBIND11_EXEC_PYTHON_ERR)
|
||||||
if(PYBIND11_EXEC_PYTHON_ERR)
|
if(PYBIND11_EXEC_PYTHON_ERR)
|
||||||
message(FATAL_ERROR "Running the tests requires pytest. Please install it manually (try: ${PYTHON_EXECUTABLE} -m pip install pytest)")
|
message(FATAL_ERROR "Running the tests requires pytest. Please install it manually (try: ${PYTHON_EXECUTABLE} -m pip install pytest)")
|
||||||
|
Loading…
Reference in New Issue
Block a user