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

[Question] running pytest-xdist in a read-only system #1006

Open
dtcMLOps opened this issue Jan 18, 2024 · 1 comment
Open

[Question] running pytest-xdist in a read-only system #1006

dtcMLOps opened this issue Jan 18, 2024 · 1 comment

Comments

@dtcMLOps
Copy link

dtcMLOps commented Jan 18, 2024

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

image

@dtcMLOps dtcMLOps changed the title [Question] running pytest-xdist in a read-only system [Question] running pytest-xdist in a read-only system Jan 18, 2024
@RonnyPfannschmidt
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants