From 0e49c022130d412dd3a42277a1a0a3b3e1c0ce78 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Wed, 4 Jan 2017 08:00:14 -0500 Subject: [PATCH] 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. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 584c617b4..763ad54a0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -88,7 +88,7 @@ endif() # Make sure pytest is found or produce a fatal error 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) if(PYBIND11_EXEC_PYTHON_ERR) message(FATAL_ERROR "Running the tests requires pytest. Please install it manually (try: ${PYTHON_EXECUTABLE} -m pip install pytest)")