-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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] Fix type hints and docstring #12067
[py] Fix type hints and docstring #12067
Conversation
Was this with Chrome and Firefox? |
Yes, I checked it in Chrome and Firefox |
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.
Thank you, @M1troll!
Codecov ReportPatch and project coverage have no change.
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## trunk #12067 +/- ##
=======================================
Coverage 54.83% 54.83%
=======================================
Files 86 86
Lines 5730 5730
Branches 233 233
=======================================
Hits 3142 3142
Misses 2355 2355
Partials 233 233
☔ View full report in Codecov by Sentry. |
Seems the linter is failing? |
Not sure what the difference is, but the command used is |
I can see the same error, I started an environment in GitPod:
I also checked out the PR locally and got the same: |
a7cade1
to
ebebacc
Compare
@diemol |
@diemol |
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.
Thank you, @M1troll!
Hello!
Description
I found that
get_attribute
method inwebelement
in docstring says that method can returnNone
, but type hint is only as a string. I ran into an unexpected error calling a string method on an NoneType-object.I also saw that docstring in
location_once_scrolled_into_view
property ofwebelement
contains an incorrect description of value returned when element is not visible.Motivation and Context
This will help you avoid unexpected errors that may be caught by typecheckers (e.g.
mypy
).Reproduce
You need install
selenium
andmypy
:Code example:
Now if we run
mypy .
we won't see any errors:But after fixing type hint, mypy will give us an error:
Types of changes
Checklist