@@ -190,6 +190,7 @@ def f():
190
190
history_cmd = captured_pane .stdout [- 2 ].strip ()
191
191
192
192
return assertCase (sent_cmd , history_cmd )
193
+
193
194
assert retry_until (f ), f"Unknown sent command: [{ sent_cmd } ] in { assertCase } "
194
195
195
196
@@ -329,6 +330,7 @@ def test_window_shell(session):
329
330
def f ():
330
331
session .server ._update_windows ()
331
332
return w ["window_name" ] != "top"
333
+
332
334
retry_until (f )
333
335
334
336
assert w .name != "top"
@@ -447,6 +449,7 @@ def test_start_directory(session, tmp_path: pathlib.Path):
447
449
448
450
for path , window in zip (dirs , session .windows ):
449
451
for p in window .panes :
452
+
450
453
def f ():
451
454
p .server ._update_panes ()
452
455
pane_path = p .current_path
@@ -497,6 +500,7 @@ def test_start_directory_relative(session, tmp_path: pathlib.Path):
497
500
498
501
for path , window in zip (dirs , session .windows ):
499
502
for p in window .panes :
503
+
500
504
def f ():
501
505
p .server ._update_panes ()
502
506
# Handle case where directories resolve to /private/ in OSX
@@ -558,6 +562,7 @@ def test_pane_order(session):
558
562
def f ():
559
563
p .server ._update_panes ()
560
564
return p .current_path == pane_path
565
+
561
566
retry_until (f )
562
567
563
568
assert p .current_path , pane_path
@@ -1014,17 +1019,20 @@ def test_load_workspace_enter(
1014
1019
builder = WorkspaceBuilder (sconf = sconfig , server = server )
1015
1020
builder .build ()
1016
1021
1017
- time .sleep (1 )
1018
-
1019
1022
session = builder .session
1020
1023
pane = session .attached_pane
1021
1024
1022
- captured_pane = "\n " .join (pane .capture_pane ())
1025
+ def fn ():
1026
+ captured_pane = "\n " .join (pane .capture_pane ())
1023
1027
1024
- if should_see :
1025
- assert output in captured_pane
1026
- else :
1027
- assert output not in captured_pane
1028
+ if should_see :
1029
+ return output in captured_pane
1030
+ else :
1031
+ return output not in captured_pane
1032
+
1033
+ assert retry_until (
1034
+ fn , 1
1035
+ ), f'Should{ " " if should_see else "not " } output in captured pane'
1028
1036
1029
1037
1030
1038
@pytest .mark .parametrize (
0 commit comments