Skip to content

xdist does not work with --assert=plain #293

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

Open
punitchandra opened this issue Apr 12, 2018 · 4 comments
Open

xdist does not work with --assert=plain #293

punitchandra opened this issue Apr 12, 2018 · 4 comments
Labels

Comments

@punitchandra
Copy link

Running
pytest --doctest-modules -v --assert=plain
works without assert rewriting.

Running
pytest --doctest-modules -v --assert=plain -n 2
is still doing the assert rewriting.

I have to use --assert=plain as the tests are using pickle and assert rewriting is creating problems with pickle. Specifically it tries to pickle typing.io which does not support pickling.

@nicoddemus nicoddemus added the bug label Apr 12, 2018
@nicoddemus
Copy link
Member

nicoddemus commented Apr 12, 2018

Hi @punitchandra, thanks for the report.

It seems the problem is that _consider_import_hook requires the --assert=plain option in the command-line, but workers don't receive the command-line parameters, only the filenames... not sure how to fix this.

@nicoddemus
Copy link
Member

@RonnyPfannschmidt is this related to pytest-dev/pytest#3376?

@RonnyPfannschmidt
Copy link
Member

@nicoddemus not yet, but its yet another reason why the detangle is needed

@simon-weber
Copy link

This also relates to #353: it's not currently possible to disable assertion rewriting for performance reasons.

I was surprised to see that setting PYTHONDONTWRITEBYTECODE didn't work either. I'll look into adding that to _consider_import_hook.

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

No branches or pull requests

4 participants