-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
tests inside package : conftest loaded multiple times ? #1889
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
Comments
Travis job illustrating the problem : https://travis-ci.org/asmodehn/pyros-setup/jobs/156150350 Note this happens only when launching pytest from the package itself (as part of When launching pytest directly it doesnt happen : https://travis-ci.org/asmodehn/pyros-setup/jobs/156141458 So there is likely a problem with the way pytest is run from main... I'd appreciate even a dirty workaround if there is no immediate fix, as it s really important for user of this package to run this test from installation... I have tried a few (like inspecting the option list before adding) but none seems to make any difference so far... Thanks a lot ! |
I put a few print statements in pytest's config.py, and it does seems like
|
While fiddling with it, it seems the first call is because of a conftest.py visible from my current directory. Changing my current dir to not have the source of the packege under the current directory fixes the problem... Is there a way for pytest to prevent collecting from current directory ? |
Maybe the |
im experiencing something similar and will investigate at work |
More information about this issue... On the other hand, having a
And sometimes not :
Seems we fail here, even before getting the Both commands were run in a virtualenv where the package was installed with For reference, the code doing the py.test run is (in
|
From memory, the behavior I described earlier (with conftest.py parsed two times) was happening when the package was installed with |
now im confident im facing the same issue |
@asmodehn i managed to revisit this one, and the isuse seems to be that the local conftest and the pyargs triggered conftest are mismatched wrt the fs location thus they are eligible for both types of import |
after reading the custom sys.path setup im reasonably sure this is self inflicted, i suggest debugging with capure disabled and printing name of the conftests |
Closing for now; we will be happy to re-open this once we get more information. |
Repository with project and commit causing the problem : pyros-dev/pyros-setup@81a4c6e
Symptom :
Recipe :
pip install -e .
Launching withpyros_setup --pytest --distro=indigo
should work fine (test fail or succeed depending on your system state and on that option)pip uninstall pyros_setup
pip install .
Launching withpyros_setup --pytest --distro=indigo
fail with the errorValueError: option names set(['--distro']) already added
On Ubuntu Trusty, here is my virtual env pip list (using system packages) :
The text was updated successfully, but these errors were encountered: