-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix deprecated messages #822
Conversation
@@ -39,7 +44,7 @@ def __init__( | |||
self._download_path = download_path | |||
self._wait_timeout = wait_timeout | |||
|
|||
self._driver = self.get_webdriver(remote) | |||
self._driver = until(lambda: self.get_webdriver(remote), timeout=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.
@alexcjohnson I change the hardcode 3x trial with the wait.until
mechanism, I can try later on remove this and get more info from the logs for debugging
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.
Oh I see, get_webdriver
swallows the error. I suppose that's OK, but the other way has the advantage that if the error persists all the way to the end it's still raised as a regular exception. perhaps build this in (optionally) to until
, or make a new until
variant until_no_error
?
raise | ||
) | ||
except WebDriverException: | ||
logger.exception("<<<Webdriver not initialized correctly>>>") |
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.
@alexcjohnson but the logger.exception
will record all the exceptions, so it's not swallowed by this function. It depends on how we configure pytest
, so all the logs could be accessible in the circleci.
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.
true, and this has the advantage that you'll actually see all the exceptions - ie if it fails 5 times you'll see all 5 - and I guess the until
will ensure that at the end of it all there at least is an exception. OK, let's do it.
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.
💃
follow the instructions in https://docs.pytest.org/en/latest/deprecations.html#message-parameter-of-pytest-raises