Skip to content

Commit e7886a2

Browse files
committed
tests(Session): new_window warning for tmux 3.0 and below
1 parent a80e7eb commit e7886a2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_session.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from libtmux import exc
1010
from libtmux.common import has_gte_version, has_lt_version
11+
from libtmux.constants import WindowDirection
1112
from libtmux.pane import Pane
1213
from libtmux.server import Server
1314
from libtmux.session import Session
@@ -327,3 +328,22 @@ def test_new_window_with_environment_logs_warning_for_old_tmux(
327328
assert any(
328329
"Environment flag ignored" in record.msg for record in caplog.records
329330
), "Warning missing"
331+
332+
333+
@pytest.mark.skipif(
334+
has_gte_version("3.1"),
335+
reason="Only 3.1 has the -a and -b flag on new-window",
336+
)
337+
def test_session_new_window_with_direction_logs_warning_for_old_tmux(
338+
session: Session,
339+
caplog: pytest.LogCaptureFixture,
340+
) -> None:
341+
"""Verify new window with direction create a warning if tmux is too old."""
342+
session.new_window(
343+
window_name="session_window_with_direction",
344+
direction=WindowDirection.After,
345+
)
346+
347+
assert any(
348+
"Direction flag ignored" in record.msg for record in caplog.records
349+
), "Warning missing"

0 commit comments

Comments
 (0)