-
Notifications
You must be signed in to change notification settings - Fork 122
remove log_path and use service_log_path consistently instead #180
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
Conversation
testing/conftest.py
Outdated
@@ -24,7 +24,7 @@ def testdir(request, httpserver_base_url): | |||
if 'testdir' not in item.funcargnames: | |||
return | |||
|
|||
testdir = request.getfuncargvalue('testdir') | |||
testdir = request.getfixturevalue('testdir') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was caught when running with DeprecationWarning enabled. @davehunt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @BeyondEvil. This was introduced in pytest 3.0.0, which we already depend on, so this is a very safe change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to be a pain and ask you to split this (and a few other things) out into a separate commit or pull request. This shouldn't break anything for anyone, but if it does it makes it easier to identify if it's not combined with an unrelated change.
testing/test_crossbrowsertesting.py
Outdated
failure('--capability', 'browser_api_name', 'FF46') | ||
out = failure('--capability', 'browser_api_name', 'FF46') | ||
messages = ['missing auth', 'basic auth failed'] | ||
assert any(message in out for message in messages) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this because the tests was passing for the wrong reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move these test fixes into a separate commit or pull request?
testing/test_testingbot.py
Outdated
@@ -75,4 +75,4 @@ def test_invalid_host(failure, monkeypatch, tmpdir): | |||
monkeypatch.setattr(os.path, 'expanduser', lambda p: str(tmpdir)) | |||
tmpdir.join('.testingbot').write('[credentials]\nkey=foo\nsecret=bar') | |||
out = failure('--host', 'foo.bar.com') | |||
assert "urlopen error" in out | |||
assert "[Errno 8] nodename nor servname provided, or not known" in out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message was different now due to Urllib3.
tox.ini
Outdated
@@ -9,7 +9,7 @@ envlist = py{27,36,37,py,py3}, docs, flake8 | |||
[testenv] | |||
passenv = DISPLAY PYTEST_ADDOPTS | |||
deps = pytest-localserver | |||
commands = pytest -v -r a {posargs} | |||
commands = pytest -W error::DeprecationWarning -v -r a {posargs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause any test to Fail if they cause any DeprecationWarnings to be invoked. @davehunt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @BeyondEvil! Just a minor nit to address before merging.
testing/conftest.py
Outdated
@@ -24,7 +24,7 @@ def testdir(request, httpserver_base_url): | |||
if 'testdir' not in item.funcargnames: | |||
return | |||
|
|||
testdir = request.getfuncargvalue('testdir') | |||
testdir = request.getfixturevalue('testdir') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @BeyondEvil. This was introduced in pytest 3.0.0, which we already depend on, so this is a very safe change.
pytest_selenium/pytest_selenium.py
Outdated
@@ -123,7 +123,6 @@ def driver_kwargs(request, capabilities, chrome_options, driver_args, | |||
host=pytestconfig.getoption('host'), | |||
port=pytestconfig.getoption('port'), | |||
request=request, | |||
log_path=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should change this to service_log_path
instead of removing it. Otherwise a driver_log
of None
would result in the default Firefox driver's log path of geckodriver.log
to be used.
I kept the |
pytest_selenium/drivers/edge.py
Outdated
|
||
|
||
def driver_kwargs(capabilities, driver_log, driver_path, **kwargs): | ||
kwargs = {} | ||
def driver_kwargs(capabilities, driver_path, service_log_path, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep the keyword argument as driver_log
as this is already our abstraction from log_path
and service_log_path
.
pytest_selenium/pytest_selenium.py
Outdated
driver_path=driver_path, | ||
firefox_options=firefox_options, | ||
firefox_profile=firefox_profile, | ||
host=pytestconfig.getoption('host'), | ||
port=pytestconfig.getoption('port'), | ||
service_log_path=driver_log, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is that driver_log
gets used within our driver_kwargs
methods to update service_log_path
, which should default to None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Would you mind splitting some things into separate commits though? Otherwise we'll have a bunch of good but unrelated changes in a single commit.
testing/conftest.py
Outdated
@@ -24,7 +24,7 @@ def testdir(request, httpserver_base_url): | |||
if 'testdir' not in item.funcargnames: | |||
return | |||
|
|||
testdir = request.getfuncargvalue('testdir') | |||
testdir = request.getfixturevalue('testdir') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to be a pain and ask you to split this (and a few other things) out into a separate commit or pull request. This shouldn't break anything for anyone, but if it does it makes it easier to identify if it's not combined with an unrelated change.
testing/test_crossbrowsertesting.py
Outdated
failure('--capability', 'browser_api_name', 'FF46') | ||
out = failure('--capability', 'browser_api_name', 'FF46') | ||
messages = ['missing auth', 'basic auth failed'] | ||
assert any(message in out for message in messages) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move these test fixes into a separate commit or pull request?
testing/test_safari.py
Outdated
@@ -9,7 +9,7 @@ | |||
|
|||
@pytest.mark.safari | |||
def test_launch(testdir, httpserver): | |||
httpserver.serve_content(content='<h1>Success!</h1>') | |||
httpserver.serve_content(content='<body><h1>Success!</h1></body>') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make this a separate commit or pull?
tox.ini
Outdated
@@ -8,6 +8,7 @@ envlist = py{27,36,37,py,py3}, docs, flake8 | |||
|
|||
[testenv] | |||
passenv = DISPLAY PYTEST_ADDOPTS | |||
setenv = MOZ_HEADLESS=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make this a separate commit or pull?
Fixes #179