[py] Raise TypeError when creating webdriver.Remote() without options#15619
[py] Raise TypeError when creating webdriver.Remote() without options#15619cgoldberg merged 13 commits intoSeleniumHQ:trunkfrom
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
WebDriverclass inpy/selenium/webdriver/remote/webdriver.pyso that it raises an error if you initialize it with without theoptionskeywoard argument.All driver classes subclass
WebDriver. You can instantiate all of them without supplying theoptionsarg, 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
TypeErrorwhenwebdriver.Remote()is called withoutoptions.Add test cases to validate the new exception behavior.
Improve error messaging for missing
optionsargument inwebdriver.Remote.Changes walkthrough 📝
webdriver.py
Add `TypeError` for missing `options` in `webdriver.Remote()`py/selenium/webdriver/remote/webdriver.py
Noneinoptionsargument.TypeErrorwith a descriptive error message whenoptionsismissing.
remote_tests.py
Add tests for missing `options` in `webdriver.Remote()`py/test/selenium/webdriver/remote/remote_tests.py
TypeErroris raised whenoptionsismissing.