The Wayback Machine - https://web.archive.org/web/20231208154106/https://github.com/SeleniumHQ/selenium/pull/10077
Skip to content
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 RelativeBy near() docs, fix bugs and deprecations in webserver.py #10077

Conversation

symonk
Copy link
Member

@symonk symonk commented Nov 23, 2021

Description

Fixed up a discrepency when invoking webserver.py standalone where host was set as the port number provided. Tidied up some of the webserver code was I was in there and stopped called a deprecated function in the stop() method of the SimpleWebServer

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. (N/A)
  • I have updated the documentation accordingly. (N/A)
  • I have added tests to cover my changes. (N/A)
  • All new and existing tests passed.

Refactored the webserver.py code to use some modern python language
features and changed invocations of deprecated functions in the
stop() method.  Running webserver.py now directly works as a bug
in the script forced both host and port to be the port.
@CLAassistant
Copy link

CLAassistant commented Nov 23, 2021

CLA assistant check
All committers have signed the CLA.

@symonk symonk changed the title [python] Tidy relativeby docs, bug fix webserver.py and stop calling deprecated methods of urllib [python] Fix RelativeBy above() docs, fix bugs and deprecations in webserver.py Nov 23, 2021
@symonk symonk changed the title [python] Fix RelativeBy above() docs, fix bugs and deprecations in webserver.py [python] Fix RelativeBy near() docs, fix bugs and deprecations in webserver.py Nov 23, 2021
default=DEFAULT_PORT)

opts, args = parser.parse_args(argv[1:])
if args:
parser.error("wrong number of arguments") # Will exit

server = SimpleWebServer(opts.port)
server = SimpleWebServer(port=opts.port)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was mistakenly setting the host= as the port.

@symonk symonk changed the title [python] Fix RelativeBy near() docs, fix bugs and deprecations in webserver.py [py] Fix RelativeBy near() docs, fix bugs and deprecations in webserver.py Nov 23, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #10077 (26e9216) into trunk (5c3ae44) will not change coverage.
The diff coverage is n/a.

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

@@           Coverage Diff           @@
##            trunk   #10077   +/-   ##
=======================================
  Coverage   44.87%   44.87%           
=======================================
  Files          86       86           
  Lines        5676     5676           
  Branches      263      263           
=======================================
  Hits         2547     2547           
  Misses       2866     2866           
  Partials      263      263           
Impacted Files Coverage Δ
py/selenium/webdriver/support/relative_locator.py 57.77% <ø> (ø)

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 bed68d1...369193e. Read the comment docs.

@AutomatedTester AutomatedTester merged commit 584c7ae into SeleniumHQ:trunk Nov 30, 2021
@sonarcloud
Copy link

sonarcloud bot commented Nov 30, 2021

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

@symonk symonk deleted the fix-deprecated-webserver-closing-method branch March 6, 2022 17:39
elgatov pushed a commit to elgatov/selenium that referenced this pull request Jun 27, 2022
SeleniumHQ#10077)

Refactored the webserver.py code to use some modern python language
features and changed invocations of deprecated functions in the
stop() method.  Running webserver.py now directly works as a bug
in the script forced both host and port to be the port.

Co-authored-by: David Burns <[email protected]>
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.

None yet

4 participants