Skip to content

Commit 4c6f747

Browse files
committed
refactor(tests): use wait_until_pane_ready instead of time.sleep
why: Using time.sleep() defeats the purpose of the waiter module, which is designed to eliminate arbitrary delays with deterministic polling. what: - Replace time.sleep(0.3) with wait_until_pane_ready(timeout=2.0) - Follows idiomatic pattern used throughout the waiter test suite - Polls until shell prompt appears rather than arbitrary delay
1 parent e3d3e08 commit 4c6f747

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/_internal/test_waiter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,9 +1413,9 @@ def test_wait_for_any_content_exact_match(wait_pane: Pane) -> None:
14131413
This specifically targets lines 823-827 in the wait_for_any_content function,
14141414
ensuring exact matching works correctly.
14151415
"""
1416-
# Clear the pane and add specific content
1416+
# Clear the pane and wait for shell to be ready (idiomatic pattern)
14171417
wait_pane.send_keys("clear", enter=True)
1418-
time.sleep(0.3) # Let terminal redraw after clear
1418+
wait_until_pane_ready(wait_pane, timeout=2.0)
14191419

14201420
# Capture the current content to match it exactly later
14211421
content = wait_pane.capture_pane()

0 commit comments

Comments
 (0)