GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(builder): deterministic pane-setup abort · tmux-python/tmuxp@0090bdc

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • tests/workspace
    • test_builder.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tests/workspace/test_builder.py‎

Copy file name to clipboardExpand all lines: tests/workspace/test_builder.py
+13-2Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,6 +2280,7 @@ def test_synchronize_restores_state_when_pane_setup_aborts(
22802280
plugin_synchronize: bool | None,
22812281
expected_local_sync: bool | None,
22822282
expected_effective_sync: bool,
2283+
monkeypatch: pytest.MonkeyPatch,
22832284
) -> None:
22842285
"""Pane setup failures restore temporarily disabled synchronize-panes state."""
22852286

@@ -2303,7 +2304,6 @@ def after_window_finished(self, window: Window) -> None:
23032304

23042305
window_config: dict[str, t.Any] = {
23052306
"window_name": f"sync-abort-{test_id}",
2306-
"layout": "not-a-layout",
23072307
"panes": [
23082308
"printf '__PANE0__\\n'",
23092309
"printf '__PANE1__\\n'",
@@ -2325,7 +2325,18 @@ def after_window_finished(self, window: Window) -> None:
23252325
plugins=plugins,
23262326
)
23272327

2328-
with pytest.raises(LibTmuxException, match="invalid layout"):
2328+
# Abort pane setup deterministically. A tmux-triggered abort (e.g. an
2329+
# invalid layout) is unusable here: its error wording varies by tmux
2330+
# version and some versions crash the server outright. Inject the
2331+
# failure in Python instead, after synchronize-panes is disabled and
2332+
# before it is restored.
2333+
def _abort_pane_setup(*args: t.Any, **kwargs: t.Any) -> t.NoReturn:
2334+
msg = "simulated pane setup failure"
2335+
raise LibTmuxException(msg)
2336+
2337+
monkeypatch.setattr(builder, "iter_create_panes", _abort_pane_setup)
2338+
2339+
with pytest.raises(LibTmuxException, match="simulated pane setup failure"):
23292340
builder.build(session=session)
23302341

23312342
window = session.windows[0]

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.