-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Path in pytest options distracts pytest.ini discovery #1435
Comments
(Just removed the |
We are fine atm with 2.6.4 Bruno Oliveira notifications@github.com schrieb am Sa., 5. März 2016,
|
Oh so in |
No, but I haven't investigated on 2.6.4. It's our production system and it IMO it is the determine_root (or so) function of the pytest config class, Sorry, just brain dumping into my phone. Bruno Oliveira notifications@github.com schrieb am Sa., 5. März 2016,
|
So it is the function determine_setup. The parameter args should not include any custom pytest options, but rather only the path(s) to the test(s). |
I've just tested pull request #1621 and it fixes this issues. |
@diegorusso thanks for testing this! 😁 |
Resolved in #1621 |
Reopening as asked in #1801 |
@matthiasha you couldn't reopen it, given that you were the OP? Just curious. 😁 |
According to stackoverflow: "you cannot re-open your own issues if a repo collaborator closed them" |
Playing around with the current pytest sources after merging #1621, I figured out that my example does still not work if you do Sorry for finding this out only after the merge :( |
lets add xfailing test for that one |
Hmm just figured out pytest==2.6.4 also cannot handle this:
But both pytest==2.6.4 and the current pytest sources can handle
as well as:
|
So I think it's easiest to handle this as a known issue. As long as a test path (a folder or a file) is given, this issue does not seem to be triggered. So maybe that should go into the documentation? |
@matthiasha good point. It is unfortunately ambiguous as it is. I guess if #1642 is implemented at least we could document that as a workaround that would allow passing paths to command-line options which wouldn't be considered to determine the Either way documenting the current behavior seems to be a good option. Would you care to open a PR? 😁 |
This covers issue pytest-dev#1435.
This covers issue pytest-dev#1435.
Please find the minimal source code example for reproducing in Archive.zip.
Without CLI options, the pytest.ini is found (first assertion in the test passes):
With a path that is part of a custom py.test CLI option, pytest.ini discovery fails:
platform linux2 -- Python 2.7.9, pytest-2.9.0, py-1.4.31, pluggy-0.3.1
Linux mzhafn-mb-ubuntu 3.19.0-43-generic #49-Ubuntu SMP Sun Dec 27 19:43:07 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid
check-manifest (0.31)
devpi-client (2.1.0)
devpi-common (2.0.8)
pip (7.1.2)
pkginfo (1.2.1)
pluggy (0.3.1)
py (1.4.31)
pytest (2.9.0)
requests (2.9.1)
setuptools (20.2.2)
tox (2.3.1)
virtualenv (14.0.6)
The text was updated successfully, but these errors were encountered: