Skip to content

Commit

Permalink
Don't write Python bytecode when invoking pytest (#533)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cottsay authored Jun 21, 2024
1 parent c6affa2 commit dfd51d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ament_cmake_pytest/cmake/ament_add_pytest_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit dfd51d4

Please sign in to comment.