11from __future__ import annotations
22
3+ from typing import TYPE_CHECKING
4+
35import pytest
46from docutils import nodes
57
68from sphinx import addnodes
79from sphinx .testing .util import SphinxTestApp
810from sphinx .transforms import MoveModuleTargets
911
12+ if TYPE_CHECKING :
13+ from pathlib import Path
14+
1015CONTENT_PY = """\
1116 move-module-targets
1217===================
2934 ],
3035)
3136@pytest .mark .usefixtures ('rollback_sysmodules' )
32- def test_move_module_targets (tmp_path , content ) :
37+ def test_move_module_targets (tmp_path : Path , content : str ) -> None :
3338 # Test for the MoveModuleTargets transform
3439 tmp_path .joinpath ('conf.py' ).touch ()
3540 tmp_path .joinpath ('index.rst' ).write_text (content , encoding = 'utf-8' )
@@ -48,7 +53,7 @@ def test_move_module_targets(tmp_path, content):
4853
4954
5055@pytest .mark .usefixtures ('rollback_sysmodules' )
51- def test_move_module_targets_no_section (tmp_path ) :
56+ def test_move_module_targets_no_section (tmp_path : Path ) -> None :
5257 # Test for the MoveModuleTargets transform
5358 tmp_path .joinpath ('conf.py' ).touch ()
5459 tmp_path .joinpath ('index.rst' ).write_text (
@@ -63,7 +68,7 @@ def test_move_module_targets_no_section(tmp_path):
6368
6469
6570@pytest .mark .usefixtures ('rollback_sysmodules' )
66- def test_move_module_targets_disabled (tmp_path ) :
71+ def test_move_module_targets_disabled (tmp_path : Path ) -> None :
6772 # Test for the MoveModuleTargets transform
6873 tmp_path .joinpath ('conf.py' ).touch ()
6974 tmp_path .joinpath ('index.rst' ).write_text (CONTENT_PY , encoding = 'utf-8' )
0 commit comments