From 0e911d734b8073457c19e5e9d734622e7e664083 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 3 Dec 2025 15:02:58 +0100 Subject: [PATCH] fixed: do not run python mpi tests without mpi --- python/simulators/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/simulators/CMakeLists.txt b/python/simulators/CMakeLists.txt index ceea5a4efa..c6afad9655 100644 --- a/python/simulators/CMakeLists.txt +++ b/python/simulators/CMakeLists.txt @@ -136,11 +136,15 @@ endif() if(OPM_ENABLE_PYTHON_TESTS) set(PYTHON_PATH ${PROJECT_BINARY_DIR}/python:${opm-common_DIR}/python:$ENV{PYTHONPATH}) + set(cases basic fluidstate_variables primary_variables schedule throw) + if(MPI_FOUND) + list(APPEND cases mpi) + endif() # NOTE: See comment in test_basic.py for the reason why we are # splitting the python tests into multiple add_test() tests instead # of having a single "python -m unittest" test call that will run all # the tests in the "test" sub directory. - foreach(case_name IN ITEMS basic fluidstate_variables mpi primary_variables schedule throw) + foreach(case_name IN ITEMS ${cases}) add_test(NAME python_${case_name} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python COMMAND ${CMAKE_COMMAND}