Skip to content

Commit dfd51d4

Browse files
authored
Don't write Python bytecode when invoking pytest (#533)
This should prevent pytest invocations via ament_add_pytest_test from writing __pycache__ directories into the package sources. Signed-off-by: Scott K Logan <[email protected]>
1 parent c6affa2 commit dfd51d4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ament_cmake_pytest/cmake/ament_add_pytest_test.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ function(ament_add_pytest_test testname path)
9999
"--junit-prefix=${PROJECT_NAME}"
100100
)
101101

102+
set(ARG_ENV PYTHONDONTWRITEBYTECODE=1 ${ARG_ENV})
103+
102104
if(ARG_NOCAPTURE)
103105
# disable output capturing
104106
list(APPEND cmd "-s")

0 commit comments

Comments
 (0)