33import re
44import sys
55import typing as t
6- from distutils .version import LooseVersion
76from typing import Optional
87
98import pytest
109
1110import libtmux
11+ from libtmux ._compat import LooseVersion
1212from libtmux .common import (
1313 TMUX_MAX_VERSION ,
1414 TMUX_MIN_VERSION ,
@@ -43,7 +43,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi:
4343 assert has_gte_version (TMUX_MIN_VERSION )
4444 assert has_gt_version (TMUX_MAX_VERSION ), "Greater than the max-supported version"
4545 assert (
46- "%s-master" % TMUX_MAX_VERSION == get_version ()
46+ LooseVersion ( "%s-master" % TMUX_MAX_VERSION ) == get_version ()
4747 ), "Is the latest supported version with -master appended"
4848
4949
@@ -63,6 +63,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi:
6363 assert has_gte_version (TMUX_MIN_VERSION )
6464 assert has_gt_version (TMUX_MAX_VERSION ), "Greater than the max-supported version"
6565 assert TMUX_NEXT_VERSION == get_version ()
66+ assert LooseVersion ("2.9" ) == get_version ()
6667
6768
6869def test_get_version_openbsd (monkeypatch : pytest .MonkeyPatch ) -> None :
@@ -78,7 +79,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi:
7879 assert has_gte_version (TMUX_MIN_VERSION )
7980 assert has_gt_version (TMUX_MAX_VERSION ), "Greater than the max-supported version"
8081 assert (
81- "%s-openbsd" % TMUX_MAX_VERSION == get_version ()
82+ LooseVersion ( "%s-openbsd" % TMUX_MAX_VERSION ) == get_version ()
8283 ), "Is the latest supported version with -openbsd appended"
8384
8485
0 commit comments