Skip to content

Commit 02fd840

Browse files
authored
Fix unit tests
1 parent 717f12e commit 02fd840

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/test_basic.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import shutil
2222
import sys
2323
from contextlib import contextmanager
24-
from distutils.version import LooseVersion
24+
from packaging.version import Version
2525
from typing import Any, Generator
2626

2727
import git as gitpython
@@ -324,7 +324,7 @@ def test_fallback(tmp_path) -> None:
324324
# https://github.com/daizutabi/mkapi#:~:text=Python%203.10%20or,1.6%20or%20higher
325325
@pytest.mark.skipif(sys.version_info < (3, 10), reason="Requires Python 3.10 or higher")
326326
@pytest.mark.skipif(
327-
LooseVersion(mkdocs.__version__) < LooseVersion("1.6"),
327+
Version(mkdocs.__version__) < Version("1.6"),
328328
reason="Requires mkdocs 1.6 or higher",
329329
)
330330
def test_mkapi_v3(tmp_path) -> None:
@@ -354,10 +354,9 @@ def test_mkapi_v20x(tmp_path) -> None:
354354
@pytest.mark.skipif(sys.version_info < (3, 7) or sys.version_info > (3, 9), reason="Requires Python 3.7 or higher")
355355
@pytest.mark.skipif(
356356
not (
357-
LooseVersion(mkdocs.__version__) < LooseVersion("2")
358-
and LooseVersion(mkdocs.__version__) >= LooseVersion("1.1.2")
357+
Version(mkdocs.__version__) < Version("1.6")
359358
),
360-
reason="Requires mkdocs >= 1.1.2, < 2",
359+
reason="Requires mkdocs >= 1.6",
361360
)
362361
def test_mkapi_v1(tmp_path) -> None:
363362
result = build_docs_setup("tests/basic_setup/mkdocs_mkapi.yml", tmp_path)

0 commit comments

Comments
 (0)