-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[py] Raise TypeError when creating webdriver.Remote() without options #15619
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
[py] Raise TypeError when creating webdriver.Remote() without options #15619
Conversation
PR Reviewer Guide 🔍(Review updated until commit 4c7622f)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 4932e43
Previous suggestionsSuggestions up to commit 925ce2d
✅ Suggestions up to commit 859dd30
✅ Suggestions up to commit 4c7622f
Suggestions up to commit 49b52fe
|
Converted this to a draft... it still needs some work. |
curious, what isn't working with this? |
I just looked again and I think it's alright. I second guessed myself because of that AI code review bot :)
But it actually is a keyword-only argument. I'll test this out one more time then merge it. |
ddba36f
to
d7741b6
Compare
User description
🔗 Related Issues
Fixes: #15618
💥 What does this PR do?
This PR changes the
WebDriver
class inpy/selenium/webdriver/remote/webdriver.py
so that it raises an error if you initialize it with without theoptions
keywoard argument.All driver classes subclass
WebDriver
. You can instantiate all of them without supplying theoptions
arg, except forwebdriver.Remote
.The following 2 code examples:
... both result in the error:
After this change, both of those code examples will result in a better error:
Relevant tests for this were added.
This shouldn't affect any other driver classes.
🔄 Types of changes
PR Type
Bug fix, Tests
Description
Raise
TypeError
whenwebdriver.Remote()
is called withoutoptions
.Add test cases to validate the new exception behavior.
Improve error messaging for missing
options
argument inwebdriver.Remote
.Changes walkthrough 📝
webdriver.py
Add `TypeError` for missing `options` in `webdriver.Remote()`
py/selenium/webdriver/remote/webdriver.py
None
inoptions
argument.TypeError
with a descriptive error message whenoptions
ismissing.
remote_tests.py
Add tests for missing `options` in `webdriver.Remote()`
py/test/selenium/webdriver/remote/remote_tests.py
TypeError
is raised whenoptions
ismissing.