Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Example of retry() -> retry_until() #776

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/test_workspacebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import libtmux
from libtmux import Window
from libtmux.common import has_gte_version
from libtmux.test import retry, temp_session
from libtmux.test import retry, retry_until, temp_session
from tmuxp import config, exc
from tmuxp.cli.load import load_plugins
from tmuxp.workspacebuilder import WorkspaceBuilder
Expand Down Expand Up @@ -102,13 +102,13 @@ def test_focus_pane_index(session):

pane_path = "/usr"

while retry():
def pane_path_matches():
p = w.attached_pane
p.server._update_panes()
if p.current_path == pane_path:
break
return True

assert p.current_path == pane_path
assert retry_until(pane_path_matches, 2, interval=0.25, raises=False)

proc = session.cmd("show-option", "-gv", "base-index")
base_index = int(proc.stdout[0])
Expand Down