diff --git a/HySoP/CMake/ParmesTests.cmake b/HySoP/CMake/ParmesTests.cmake index 28ebbc4f39c0aabae4f7a737cf01bf6e4d1c13d5..3326a2ee8b0b801c1461dceb6d644d8747cd25be 100644 --- a/HySoP/CMake/ParmesTests.cmake +++ b/HySoP/CMake/ParmesTests.cmake @@ -23,6 +23,9 @@ endif() # Set test dir to python build dir. set(testDir ${CMAKE_BINARY_DIR}/build/${${PROJECT_NAME}_PYTHON_BUILD_DIR}) +set(ENV{PYTHONPATH} ${testDir}) + +display(testDir) ## Build a list of test_*.py files for each directory of parmepy/${py_src_dirs} set(py_test_files) @@ -73,3 +76,6 @@ foreach(testfile ${py_doctest_files}) add_test("doctest_${testName}" py.test -v ${testfile}) endforeach() message(STATUS "===") + + +#configure_file(conftest.py.in conftest.py) \ No newline at end of file diff --git a/HySoP/hysop/__init__.py.in b/HySoP/hysop/__init__.py.in index 46a9e821b76e1758573773387d4989094b416901..7be56d3b0dfabfa1eaf9dc951fca2aaf7f45b035 100755 --- a/HySoP/hysop/__init__.py.in +++ b/HySoP/hysop/__init__.py.in @@ -52,8 +52,3 @@ Field = fields.continuous.Field ## from tools.explore_hardware import explore -if("@WITH_TEST@" is "ON"): - import pytest - @pytest.fixture(autouse=True) - def parmetest(): - monkeypatch.setenv("PYTHONPATH", "@testDir@") diff --git a/HySoP/setup.py.in b/HySoP/setup.py.in index 8d822a6c1db46b44fffaadbebb77791d8f45a007..34ab925a5b6e0d8401609e7c7471126ea6616598 100644 --- a/HySoP/setup.py.in +++ b/HySoP/setup.py.in @@ -35,11 +35,11 @@ packages_for_tests = ['parmepy.domain.tests', if("@USE_MPI@" is "ON"): packages.append('parmepy.mpi') - packages_for_tests.append('parmepy.mpi') + packages_for_tests.append('parmepy.mpi.tests') if("@WITH_GPU@" is "ON"): packages.append('parmepy.gpu') - packages_for_tests.append('parmepy.gpu') + packages_for_tests.append('parmepy.gpu.tests') if("@WITH_TESTS@" is "ON"): packages = packages + packages_for_tests