Skip to content

Commit

Permalink
Don't write Python bytecode when invoking pytest
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.
  • Loading branch information
cottsay committed Jun 17, 2024
1 parent fdbf457 commit dc75c9c
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 dc75c9c

Please sign in to comment.