Skip to content

Commit 291be61

Browse files
committed
Server(test[connect]): cover connect() under control engine
why: Ensure Server.connect behaves identically for subprocess and control engines. what: - Parametrize connect tests with engines marker for both modes
1 parent eb83aed commit 291be61

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/test_server.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,15 @@ def test_new_session_shell_env(server: Server) -> None:
158158
assert pane_start_command.replace('"', "") == cmd
159159

160160

161+
@pytest.mark.engines(["subprocess", "control"])
161162
def test_connect_creates_new_session(server: Server) -> None:
162163
"""Server.connect creates a new session when it doesn't exist."""
163164
session = server.connect("test_connect_new")
164165
assert session.name == "test_connect_new"
165166
assert session.session_id is not None
166167

167168

169+
@pytest.mark.engines(["subprocess", "control"])
168170
def test_connect_reuses_existing_session(server: Server, session: Session) -> None:
169171
"""Server.connect reuses an existing session instead of creating a new one."""
170172
# First call creates
@@ -178,6 +180,7 @@ def test_connect_reuses_existing_session(server: Server, session: Session) -> No
178180
assert session2.name == "test_connect_reuse"
179181

180182

183+
@pytest.mark.engines(["subprocess", "control"])
181184
def test_connect_invalid_name(server: Server) -> None:
182185
"""Server.connect raises BadSessionName for invalid session names."""
183186
with pytest.raises(exc.BadSessionName):

0 commit comments

Comments
 (0)