Skip to content

Commit f0404d6

Browse files
committed
test(hooks): Mark raw_cmd and dataclass tests as subprocess-only
why: Control mode requires explicit -t targets for show-hooks; subprocess mode inherits context from TMUX environment variable. what: - Add @pytest.mark.engines(["subprocess"]) to test_hooks_raw_cmd - Add @pytest.mark.engines(["subprocess"]) to test_hooks_dataclass - Document reason in test docstrings
1 parent 4cc4606 commit f0404d6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/test_hooks.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@
1414
from libtmux.server import Server
1515

1616

17+
@pytest.mark.engines(["subprocess"])
1718
def test_hooks_raw_cmd(
1819
server: Server,
1920
) -> None:
20-
"""Raw hook set, show, unset via cmd."""
21+
"""Raw hook set, show, unset via cmd.
22+
23+
Note: This test is subprocess-only because control mode requires explicit
24+
targets (-t) for show-hooks to work correctly. In subprocess mode, tmux
25+
inherits session context from the TMUX environment variable.
26+
"""
2127
session = server.new_session(session_name="test hooks")
2228
window = session.attached_window
2329
pane = window.attached_pane
@@ -193,10 +199,16 @@ def test_hooks_raw_cmd(
193199
assert pane.cmd("show-hooks", "-p", "session-renamed[0]").stdout == []
194200

195201

202+
@pytest.mark.engines(["subprocess"])
196203
def test_hooks_dataclass(
197204
server: Server,
198205
) -> None:
199-
"""Tests for hooks dataclass."""
206+
"""Tests for hooks dataclass.
207+
208+
Note: This test is subprocess-only because control mode requires explicit
209+
targets (-t) for show-hooks to work correctly. In subprocess mode, tmux
210+
inherits session context from the TMUX environment variable.
211+
"""
200212
session = server.new_session(session_name="test hooks")
201213
window = session.attached_window
202214
pane = window.attached_pane

0 commit comments

Comments
 (0)