Skip to content

fix(options): type wait_for_quiescence setter as bool - #1344

Open
MattL1989 wants to merge 1 commit into
appium:masterfrom
MattL1989:fix/wait-for-quiescence-type-hint
Open

MattL1989 wants to merge 1 commit into
appium:masterfrom
MattL1989:fix/wait-for-quiescence-type-hint

Conversation

@MattL1989

Copy link
Copy Markdown
Contributor

Problem

waitForQuiescence is a boolean XCUITest capability, and XCUITestOptions.wait_for_quiescence is annotated to return bool | None. Its setter, however, was annotated as value: timedelta | float, which looks copied from the neighbouring timeout options such as wait_for_idle_timeout.

As a result, type checkers accepted options.wait_for_quiescence = timedelta(seconds=1). That value is stored unchanged and cannot be serialized when the session is created.

Fix

Annotate the setter as value: bool, consistent with the getter and with the other boolean options such as auto_accept_alerts. Remove the timedelta import, which is now unused. There is no runtime change.

Tests

  • With the fix, mypy rejects options.wait_for_quiescence = timedelta(seconds=1) and still accepts options.wait_for_quiescence = False.
  • ruff check, ruff format --check, mypy appium and the full unit test suite pass.

🤖 Generated with Claude Code

waitForQuiescence is a boolean XCUITest capability and the getter returns
bool, but the setter was annotated as accepting timedelta | float, copied
from the timeout options. Type checkers therefore accepted a timedelta,
which cannot be serialized when the session is created.

Annotate the setter as bool and drop the unused timedelta import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K6zVKi1DtwmmBpy16MQyfY
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.

1 participant