Skip to content

Reflect how find_elements returns a list, not just one WebElement#10172

Merged
titusfortner merged 1 commit intoSeleniumHQ:trunkfrom
colons:issue/find-elements-return-type
Dec 24, 2021
Merged

Reflect how find_elements returns a list, not just one WebElement#10172
titusfortner merged 1 commit intoSeleniumHQ:trunkfrom
colons:issue/find-elements-return-type

Conversation

@colons
Copy link
Copy Markdown
Contributor

@colons colons commented Dec 21, 2021

Description (and motivation and context)

The author of python/typeshed#6565 seems to have been misled by the return types changed here, and it caused mypy to make a lot of complaints in a codebase I work on. Here, like in python/typeshed#6645, those annotations are corrected to reflect that any method with find_elements in the name returns a list.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 21, 2021

CLA assistant check)
All committers have signed the CLA.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #10172 (8329436) into trunk (10fed03) will increase coverage by 0.02%.
The diff coverage is 38.88%.

❗ Current head 8329436 differs from pull request most recent head b4623ab. Consider uploading reports for the commit b4623ab to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##            trunk   #10172      +/-   ##
==========================================
+ Coverage   44.88%   44.90%   +0.02%     
==========================================
  Files          86       86              
  Lines        5659     5663       +4     
  Branches      264      265       +1     
==========================================
+ Hits         2540     2543       +3     
  Misses       2855     2855              
- Partials      264      265       +1     
Impacted Files Coverage Δ
py/selenium/webdriver/remote/webdriver.py 39.69% <0.00%> (ø)
py/selenium/webdriver/remote/shadowroot.py 27.58% <41.66%> (+11.58%) ⬆️
py/selenium/webdriver/chrome/service.py 78.57% <50.00%> (ø)
py/selenium/webdriver/chrome/webdriver.py 63.33% <50.00%> (ø)
py/selenium/webdriver/edge/service.py 82.35% <50.00%> (ø)
py/selenium/webdriver/edge/webdriver.py 69.56% <50.00%> (ø)
py/selenium/webdriver/ie/webdriver.py 65.27% <50.00%> (ø)
py/selenium/webdriver/wpewebkit/service.py 36.36% <50.00%> (ø)
py/selenium/webdriver/wpewebkit/webdriver.py 36.00% <50.00%> (ø)
py/selenium/webdriver/ie/service.py 88.88% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ba1869...b4623ab. Read the comment docs.

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@colons colons mentioned this pull request Dec 21, 2021
8 tasks
@colons
Copy link
Copy Markdown
Contributor Author

colons commented Dec 21, 2021

problems like this (and #10120) would be much easier to spot if you disabled a bunch of the warnings in your mypy.ini; right now, outright errors are difficult to spot because they're drowned in complaints about stuff that's just not annotated at all

this concerns me because, in the mean time, these incorrect annotations have caused problems in a codebase i work on

i strongly recommend you follow mypy's advice about how to migrate existing codebases rather than turning on every message right from the start

@titusfortner titusfortner merged commit d7a3648 into SeleniumHQ:trunk Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants