Skip to content

[py] Add unit tests for selenium.webdriver.common.timeouts#17389

Open
EternalRights wants to merge 3 commits intoSeleniumHQ:trunkfrom
EternalRights:add-timeouts-unit-tests
Open

[py] Add unit tests for selenium.webdriver.common.timeouts#17389
EternalRights wants to merge 3 commits intoSeleniumHQ:trunkfrom
EternalRights:add-timeouts-unit-tests

Conversation

@EternalRights
Copy link
Copy Markdown

Ran into this while looking at test coverage gaps in the Python bindings. The timeouts module had zero tests despite having some non-trivial logic (descriptor pattern for ms<->sec conversion, type validation, JSON serialization with zero-value omission).

Covered:

  • init with int/float/zero defaults
  • _convert: seconds to ms, type error on bad input
  • _TimeoutsDescriptor: get returns sec, set stores ms, roundtrip
  • _to_json: zero values excluded, values in ms

Style follows existing tests in this directory (by_tests, proxy_tests).

@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Add unit tests for selenium.webdriver.common.timeouts

🧪 Tests

Grey Divider

Walkthroughs

Description
• Add comprehensive unit tests for Timeouts class initialization
• Test _convert method for seconds-to-milliseconds conversion
• Test _TimeoutsDescriptor descriptor pattern for get/set behavior
• Test _to_json serialization with zero-value omission

Grey Divider

File Changes

1. py/test/unit/selenium/webdriver/common/timeouts_tests.py 🧪 Tests +187/-0

Comprehensive unit tests for Timeouts class

• New test file with 187 lines covering Timeouts class functionality
• Tests initialization with int, float, and zero defaults
• Tests _convert method for type validation and ms conversion
• Tests descriptor pattern for get/set roundtrip behavior
• Tests _to_json serialization excluding zero values

py/test/unit/selenium/webdriver/common/timeouts_tests.py


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented Apr 25, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@selenium-ci selenium-ci added the C-py Python Bindings label Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-py Python Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants