Skip to content

Commit

Permalink
!squash more test_builder
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Sep 3, 2023
1 parent be74f56 commit 9f89524
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/workspace/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ def f_check_again():
assert p.pane_current_path == pane_path


class AssertCallbackProtocol(t.Protocol):
def __call__(self, cmd:str, hist: str) -> bool:
...

@pytest.mark.skip(
reason="""
Test needs to be rewritten, assertion not reliable across platforms
Expand Down Expand Up @@ -182,7 +186,7 @@ def assertIsMissing(cmd, hist):
buffer_name = "test"
sent_cmd = None

def f():
def f(p: Pane, buffer_name:str, assertCase: AssertCallbackProtocol) -> bool:
# from v0.7.4 libtmux session.cmd adds target -t self.id by default
# show-buffer doesn't accept -t, use global cmd.

Expand All @@ -198,7 +202,9 @@ def f():

return assertCase(sent_cmd, history_cmd)

assert retry_until(f), f"Unknown sent command: [{sent_cmd}] in {assertCase}"
_f = functools.partial(f, p=p, buffer_name=buffer_name, assertCase=assertCase)

assert retry_until(_f), f"Unknown sent command: [{sent_cmd}] in {assertCase}"


def test_session_options(session):
Expand Down

0 comments on commit 9f89524

Please sign in to comment.