Skip to content

Commit fbc17ee

Browse files
committed
tests: remove obsolete < 3.2 skipif markers
why: tmux < 3.2 is now deprecated (TMUX_SOFT_MIN_VERSION = "3.2a"). All version skipif markers for < 3.0, < 3.2, <= 3.1, and < 2.9 are now obsolete since all supported tmux versions have these features. what: - Remove skipif(has_lt_version("3.0")) from environment tests - Remove skipif(has_lt_version("3.2")) from window direction tests - Remove skipif(has_lt_version("2.9")) from resize tests - Remove skipif(has_lte_version("3.1")) from zoom tests - Clean up unused imports (has_lt_version, has_lte_version)
1 parent b61b561 commit fbc17ee

File tree

5 files changed

+5
-53
lines changed

5 files changed

+5
-53
lines changed

tests/legacy_api/test_session.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pytest
1010

1111
from libtmux import exc
12-
from libtmux.common import has_gte_version, has_lt_version
12+
from libtmux.common import has_gte_version
1313
from libtmux.pane import Pane
1414
from libtmux.session import Session
1515
from libtmux.test.constants import TEST_SESSION_PREFIX
@@ -264,10 +264,6 @@ def test_cmd_inserts_session_id(session: Session) -> None:
264264
assert cmd.cmd[-1] == last_arg
265265

266266

267-
@pytest.mark.skipif(
268-
has_lt_version("3.0"),
269-
reason="needs -e flag for new-window which was introduced in 3.0",
270-
)
271267
@pytest.mark.parametrize(
272268
"environment",
273269
[

tests/legacy_api/test_window.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import pytest
1111

1212
from libtmux import exc
13-
from libtmux.common import has_gte_version, has_lt_version, has_version
13+
from libtmux.common import has_gte_version, has_version
1414
from libtmux.constants import OptionScope
1515
from libtmux.pane import Pane
1616
from libtmux.server import Server
@@ -405,10 +405,6 @@ def test_select_layout_accepts_no_arg(server: Server, session: Session) -> None:
405405
window.select_layout()
406406

407407

408-
@pytest.mark.skipif(
409-
has_lt_version("3.2"),
410-
reason="needs filter introduced in tmux >= 3.2",
411-
)
412408
def test_empty_window_name(session: Session) -> None:
413409
"""New windows can be created with empty string for window name."""
414410
session.set_option("automatic-rename", "off")
@@ -428,10 +424,6 @@ def test_empty_window_name(session: Session) -> None:
428424
assert "''" in cmd.stdout
429425

430426

431-
@pytest.mark.skipif(
432-
has_lt_version("3.0"),
433-
reason="needs -e flag for split-window which was introduced in 3.0",
434-
)
435427
@pytest.mark.parametrize(
436428
"environment",
437429
[

tests/test_pane.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import pytest
1111

12-
from libtmux.common import has_gte_version, has_lt_version, has_lte_version
12+
from libtmux.common import has_gte_version
1313
from libtmux.constants import PaneDirection, ResizeAdjustmentDirection
1414
from libtmux.test.retry import retry_until
1515

@@ -158,10 +158,6 @@ def test_capture_pane_end(session: Session) -> None:
158158
assert pane_contents == '$ printf "%s"\n$'
159159

160160

161-
@pytest.mark.skipif(
162-
has_lte_version("3.1"),
163-
reason="3.2 has the -Z flag on split-window",
164-
)
165161
def test_pane_split_window_zoom(
166162
session: Session,
167163
) -> None:
@@ -188,10 +184,6 @@ def test_pane_split_window_zoom(
188184
assert pane_with_zoom.height == pane_with_zoom.window_height
189185

190186

191-
@pytest.mark.skipif(
192-
has_lt_version("2.9"),
193-
reason="resize-window only exists in tmux 2.9+",
194-
)
195187
def test_resize_pane(
196188
session: Session,
197189
) -> None:

tests/test_session.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import pytest
1111

1212
from libtmux import exc
13-
from libtmux.common import has_gte_version, has_lt_version
13+
from libtmux.common import has_gte_version
1414
from libtmux.constants import WindowDirection
1515
from libtmux.pane import Pane
1616
from libtmux.session import Session
@@ -315,10 +315,6 @@ class SessionWindowEnvironmentFixture(t.NamedTuple):
315315
]
316316

317317

318-
@pytest.mark.skipif(
319-
has_lt_version("3.0"),
320-
reason="needs -e flag for new-window which was introduced in 3.0",
321-
)
322318
@pytest.mark.parametrize(
323319
list(SessionWindowEnvironmentFixture._fields),
324320
SESSION_WINDOW_ENV_FIXTURES,
@@ -370,10 +366,6 @@ def test_new_window_with_environment_logs_warning_for_old_tmux(
370366
)
371367

372368

373-
@pytest.mark.skipif(
374-
has_lt_version("3.2"),
375-
reason="Only 3.2+ has the -a and -b flag on new-window",
376-
)
377369
def test_session_new_window_with_direction(
378370
session: Session,
379371
) -> None:

tests/test_window.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from libtmux import exc
1414
from libtmux._internal.query_list import ObjectDoesNotExist
15-
from libtmux.common import has_gte_version, has_lt_version, has_lte_version
15+
from libtmux.common import has_gte_version
1616
from libtmux.constants import (
1717
OptionScope,
1818
PaneDirection,
@@ -444,10 +444,6 @@ def test_select_layout_accepts_no_arg(server: Server, session: Session) -> None:
444444
window.select_layout()
445445

446446

447-
@pytest.mark.skipif(
448-
has_lt_version("3.2"),
449-
reason="needs filter introduced in tmux >= 3.2",
450-
)
451447
def test_empty_window_name(session: Session) -> None:
452448
"""New windows can be created with empty string for window name."""
453449
session.set_option("automatic-rename", "off")
@@ -486,10 +482,6 @@ class WindowSplitEnvironmentFixture(t.NamedTuple):
486482
]
487483

488484

489-
@pytest.mark.skipif(
490-
has_lt_version("3.0"),
491-
reason="needs -e flag for split-window which was introduced in 3.0",
492-
)
493485
@pytest.mark.parametrize(
494486
list(WindowSplitEnvironmentFixture._fields),
495487
WINDOW_SPLIT_ENV_FIXTURES,
@@ -517,10 +509,6 @@ def test_split_with_environment(
517509
assert pane.capture_pane()[-2] == v
518510

519511

520-
@pytest.mark.skipif(
521-
has_lte_version("3.1"),
522-
reason="3.2 has the -Z flag on split-window",
523-
)
524512
def test_split_window_zoom(
525513
session: Session,
526514
) -> None:
@@ -566,10 +554,6 @@ def test_split_with_environment_logs_warning_for_old_tmux(
566554
)
567555

568556

569-
@pytest.mark.skipif(
570-
has_lt_version("2.9"),
571-
reason="resize-window only exists in tmux 2.9+",
572-
)
573557
def test_resize(
574558
session: Session,
575559
) -> None:
@@ -646,10 +630,6 @@ def test_resize(
646630
assert window_height_before < window_height_expanded
647631

648632

649-
@pytest.mark.skipif(
650-
has_lt_version("3.2"),
651-
reason="Only 3.2+ has the -a and -b flag on new-window",
652-
)
653633
def test_new_window_with_direction(
654634
session: Session,
655635
) -> None:

0 commit comments

Comments
 (0)