diff --git a/colcon_core/task/python/test/__init__.py b/colcon_core/task/python/test/__init__.py index ef5298bc..74a5ed2b 100644 --- a/colcon_core/task/python/test/__init__.py +++ b/colcon_core/task/python/test/__init__.py @@ -73,6 +73,9 @@ async def test(self, *, additional_hooks=None): # noqa: D102 logger.log(1, f"test.step() by extension '{key}'") try: + if 'PYTHONDONTWRITEBYTECODE' not in env: + env = dict(env) + env['PYTHONDONTWRITEBYTECODE'] = '1' return await extension.step(self.context, env, setup_py_data) except Exception as e: # noqa: F841 # catch exceptions raised in python testing step extension diff --git a/test/spell_check.words b/test/spell_check.words index a1cb3d99..28095ef9 100644 --- a/test/spell_check.words +++ b/test/spell_check.words @@ -79,6 +79,7 @@ purelib pydocstyle pytest pytests +pythondontwritebytecode pythonpath pythonscriptspath pythonwarnings