From dc75c9ce41238a6413cb7fa56ac9afdb7f6527e0 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Mon, 17 Jun 2024 09:19:47 -0500 Subject: [PATCH] Don't write Python bytecode when invoking pytest This should prevent pytest invocations via ament_add_pytest_test from writing __pycache__ directories into the package sources. --- ament_cmake_pytest/cmake/ament_add_pytest_test.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ament_cmake_pytest/cmake/ament_add_pytest_test.cmake b/ament_cmake_pytest/cmake/ament_add_pytest_test.cmake index 7afe858a..06abfbd1 100644 --- a/ament_cmake_pytest/cmake/ament_add_pytest_test.cmake +++ b/ament_cmake_pytest/cmake/ament_add_pytest_test.cmake @@ -99,6 +99,8 @@ function(ament_add_pytest_test testname path) "--junit-prefix=${PROJECT_NAME}" ) + set(ARG_ENV PYTHONDONTWRITEBYTECODE=1 ${ARG_ENV}) + if(ARG_NOCAPTURE) # disable output capturing list(APPEND cmd "-s")