Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't write bytecode when invoking Python tests #611

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions colcon_core/task/python/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@

logger.log(1, f"test.step() by extension '{key}'")
try:
if 'PYTHONDONTWRITEBYTECODE' not in env:
env = dict(env)
env['PYTHONDONTWRITEBYTECODE'] = '1'

Check warning on line 78 in colcon_core/task/python/test/__init__.py

View check run for this annotation

Codecov / codecov/patch

colcon_core/task/python/test/__init__.py#L77-L78

Added lines #L77 - L78 were not covered by tests
return await extension.step(self.context, env, setup_py_data)
except Exception as e: # noqa: F841
# catch exceptions raised in python testing step extension
Expand Down
1 change: 1 addition & 0 deletions test/spell_check.words
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ purelib
pydocstyle
pytest
pytests
pythondontwritebytecode
pythonpath
pythonscriptspath
pythonwarnings
Expand Down
Loading