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

Poor interaction between -n# and -c X.cfg #6

Closed
soltanmm opened this issue Sep 14, 2015 · 9 comments · Fixed by #448
Closed

Poor interaction between -n# and -c X.cfg #6

soltanmm opened this issue Sep 14, 2015 · 9 comments · Fixed by #448

Comments

@soltanmm
Copy link

Specifying e.g. -n8 appears to cause py.test options in config files e.g.

[pytest]
python_files = *_test.py

to be ignored when they're specified by invocations of the form py.test -c /something/elsewhere/setup.cfg -n8. This doesn't appear to be a problem when invoking py.test directly in a setup.py shim s.t. the setup.cfg is automagically found by py.test.

I've only stared at this for a little while, however, and may have missed a few things. Pointers?

cc @nathanielmanistaatgoogle

@RonnyPfannschmidt
Copy link
Member

I'm not sure I understand, can you perhaps create an example project

@soltanmm
Copy link
Author

Certainly.

To replicate the error, add some out-of-tree setup.cfg file...

[pytest]
python_files = *

... to some path $OTHER_SETUP, create a virtualenv, and pip install the example project in the virtualenv.

The invocations to replicate from the virtualenv root are then: ./bin/py.test -c $OTHER_SETUP --pyargs mypkg -v vs. ./bin/py.test -c $OTHER_SETUP -n8 --pyargs mypkg -v.

The first command should fail as expected because it's using the $OTHER_SETUP file which selects for all python files, although one of the tests really shouldn't run. The second command erroneously succeeds because it appears to ignore the bad configuration file.

(I apologize for the double negative example; was in a hurry)

@RonnyPfannschmidt
Copy link
Member

should be fixed in the pytest feature branch

@nicoddemus
Copy link
Member

@soltanmm could you please verify if the features branch fixes this, as @RonnyPfannschmidt mentioned? If that's the case we could close this.

@dubglan
Copy link

dubglan commented Apr 9, 2016

@RonnyPfannschmidt, we're observing the same behavior from issue #5 with pytest==2.9.1 and pytest-xdist==1.14:
Runs tests:
.../py.test --collect-only -n 3
Prints the list of tests:
.../py.test --collect-only -n 0

@davehunt
Copy link

davehunt commented Oct 6, 2017

Was this resolved by #232?

@RonnyPfannschmidt
Copy link
Member

nope

@davehunt
Copy link

davehunt commented Oct 6, 2017

nope

Okay, I asked because #5 (comment) suggests that this is a duplicate issue. Thanks.

@RonnyPfannschmidt
Copy link
Member

@davehunt this one is due to broken config handling in pytest - due to completely broken initialization of the pytest config, the initialization in xdist worker processes is inconsistent and different from the controlling process

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

Successfully merging a pull request may close this issue.

5 participants