Skip to content

Commit eab61f7

Browse files
committed
test: fix test_wait_until_pane_ready for CI environments
- Modified the test to dynamically detect and use the current shell prompt ($ or %) - This makes the test more robust across different environments including CI - Previously the test was hardcoded to use '%' which works locally with zsh but fails in CI with bash
1 parent aba2cd9 commit eab61f7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/test/test_waiter.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,16 @@ def test_wait_until_pane_ready(wait_pane: Pane) -> None:
196196
content_str = "\n".join(content)
197197
assert content_str # Ensure it's not None or empty
198198

199-
# We know from the test that the shell prompt is using '%' (zsh)
200-
# So we'll use that directly rather than trying to detect it
201-
result = wait_until_pane_ready(wait_pane, shell_prompt="%")
199+
# Check for the actual prompt character to use
200+
if "$" in content_str:
201+
prompt = "$"
202+
elif "%" in content_str:
203+
prompt = "%"
204+
else:
205+
prompt = None # Use auto-detection
206+
207+
# Use the detected prompt or let auto-detection handle it
208+
result = wait_until_pane_ready(wait_pane, shell_prompt=prompt)
202209

203210
assert result.success
204211
assert result.content is not None

0 commit comments

Comments
 (0)