{{ message }}
Repository navigation
Commit c1ed962
committed
tests(refactor[plugin_system]) Use Pane.display_message wrapper
why: Six tests in the plugin-system suite were querying tmux for
session/window names via the same `session.cmd("display-message",
"-p", "'#S'")` escape hatch that production just migrated away
from in `cli/load.py:_reattach`. Keeping the tests on the typed
wrapper that production now uses keeps the call shape consistent
across the codebase and removes the last `cmd("display-message",
...)` site from the repo.
what:
- `tests/cli/test_cli.py::test_reattach_plugins`: replace the
`cmd()` call with `active_pane.display_message("'#S'",
get_text=True)` so the post-reattach assertion uses the typed
wrapper.
- `tests/workspace/test_builder.py`: migrate four
`test_plugin_system_*` checks (`before_workspace_builder`,
`on_window_create`, `after_window_finished`, and the
multi-window variant covering both `before_script` and
`after_window_finished`) onto `active_pane.display_message()`.
The multi-window variant hoists the active_pane lookup once and
reuses it for both the `'#S'` and `'#W'` queries.
- Each call site adds a narrowing assert on `active_pane`
(libtmux types it as `Pane | None`) so mypy can prove the call
is well-typed. Mirrors the production assert added in
`_reattach()`.
No behavior change: tmux's `display-message` defaults to the
session's active pane when no `-t` is passed, so the underlying
tmux invocations are byte-for-byte identical to the prior
`session.cmd(...)` calls.1 parent 32f62cf commit c1ed962
2 files changed
Lines changed: 23 additions & 12 deletions

0 commit comments