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

Problem reading --variables from pytest.ini if --driver-path specified #105

Closed
birdsarah opened this issue Mar 18, 2017 · 4 comments
Closed

Comments

@birdsarah
Copy link
Contributor

Not sure how best to investigate this or if this is even a pytest selenium problem.

On Windows 10.

I have a pytest.ini file

[pytest]
addopts = --variables=variables.json

If I run the following (with chromedriver available on the path):

$ py.test --base-url www.google.com --driver Chrome

Then the variables.json is picked up correctly.

However, if I run the following:

$ py.test --base-url www.google.com --driver Chrome --driver-path ..\..\..\WebDrivers\chromedriver.exe

Then variables.json is not picked up for the variables option.

Finally though, if I add --variables variables.json into the call then it does work:

$ py.test --base-url www.google.com --driver Chrome --driver-path ..\..\..\WebDrivers\chromedriver.exe --variables variables.json
@davehunt
Copy link
Contributor

That sounds more like a pytest issue. Could you paste your pytest header (showing rootdir, inifile, etc). Also, do you get the same when you use = for all command line options? I've seen issues when values are paths can confuse the rootdir lookup.

@birdsarah
Copy link
Contributor Author

Also, do you get the same when you use = for all command line options? I've seen issues when values are paths can confuse the rootdir lookup.

This is it. If I use = for all then I don't get the issue. But that shouldn't be necessary. Agree this is not a pytest-selenium issue. You think this should be in main pytest repo?

@davehunt
Copy link
Contributor

So there was pytest-dev/pytest#1471, pytest-dev/pytest#1435, pytest-dev/pytest#1594, which were all addressed by pytest-dev/pytest#1621. It seems like there's still an issue when the test paths are omitted, or the last argument is a path (but not a test path). It's possible this would be addressed by pytest-dev/pytest#1642 but that would still require a user to know about that option. There is a note about this in the documentation, but it's easy to miss.

@davehunt
Copy link
Contributor

Closing this, as it's not a plugin issue.

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

No branches or pull requests

2 participants