diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a7f1ba8597326d7617a4c5db54a66417dd7674a..89edafe4a01092ce32b22c6dd65f37fddb591780 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,11 +26,11 @@ set(DUNE_TESTTOOLS_PATH ${PROJECT_SOURCE_DIR})
 dune_python_install_package(PATH python)
 
 dune_python_add_test(NAME pytest
-                     COMMAND ${DUNE_PYTHON_VIRTUALENV_EXECUTABLE} -m pytest
+                     SCRIPT pytest
                      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python
                      )
 dune_python_add_test(NAME pep8
-                     COMMAND ${DUNE_PYTHON_VIRTUALENV_EXECUTABLE} -m pytest --pep8
+                     SCRIPT pytest --pep8
                      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python
                      )