pytest-xdist
pytest-xdist copied to clipboard
[Question] running `pytest-xdist` in a read-only system
Hi team,
Greetings.
I have a question regarding the plugin when running in a read-only system like Databricks job clusters. I have disabled __pycache__ creation when running pytest with:
PYTHONDONTWRITEBYTECODE=1 and sys.dont_write_bytecode = True.
The tests were running successfully, but when I tried to enable the pytest-xdist plugin support with the -n logical or -n auto argument, pytest is creating the __pycache__ directory again and my run failed. I am guessing this is related to the pytest-xdist plugin.
Do you know if there is a way to tell pytest-xdist no to generate the __pycache__ directory?
Aditional context
i believe the PYTHONDONTWRITEBYTECODE env var should pass over to popen subprocesses
execnet has a flag for passing -B to python to ensure no bytecode is written but its not exposed easily for xdist