-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Mixing relative and absolute paths to tests fails pytest.ini lookup #949
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
As a workaround one could set the -c CONFIGFILE option. |
One way to solve this would be changing |
Hmm accordingly to the docs in determining rootdir and inifile, because there are no The fact that you pass Consider: def determine_setup(inifile, args):
print('determine_setup', args)
if inifile:
iniconfig = py.iniconfig.IniConfig(inifile)
... When I execute (omitting some output for brevity)
But if I pass a flag (say
Note that it doesn't find
|
I don't think they are related. The example of having an option that makes it work, was just an extra side note. This is related to not finding the pytest.ini at all, without the option. |
I think this issue is wrongly closed. |
Based on your example and the documentation, it was not supposed to find a The documentation says:
In your example, your structure was as follows:
Consider the following scenarios (let's assume CWD is
In this case, the common ancestor of the files given in the command line is
In this situation, pytest shouldn't find any Hope this explanation makes sense. 😅 Sorry for not posting an explanation before! |
Please see the below simple reproduction of the problem. When mixing relative and absolute path configuration file resolution as per https://pytest.org/latest/customize.html
First execution just relative path (finds pytest.ini)
Second execution with relative and absolute (does not find pytest.ini)
Third execution with argument -s between relative and absolute path (does find pytest.ini)... strange...
The text was updated successfully, but these errors were encountered: