1
1
from __future__ import annotations
2
2
3
+ from typing import TYPE_CHECKING
4
+
3
5
import pytest
4
6
from docutils import nodes
5
7
6
8
from sphinx import addnodes
7
9
from sphinx .testing .util import SphinxTestApp
8
10
from sphinx .transforms import MoveModuleTargets
9
11
12
+ if TYPE_CHECKING :
13
+ from pathlib import Path
14
+
10
15
CONTENT_PY = """\
11
16
move-module-targets
12
17
===================
29
34
],
30
35
)
31
36
@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 :
33
38
# Test for the MoveModuleTargets transform
34
39
tmp_path .joinpath ('conf.py' ).touch ()
35
40
tmp_path .joinpath ('index.rst' ).write_text (content , encoding = 'utf-8' )
@@ -48,7 +53,7 @@ def test_move_module_targets(tmp_path, content):
48
53
49
54
50
55
@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 :
52
57
# Test for the MoveModuleTargets transform
53
58
tmp_path .joinpath ('conf.py' ).touch ()
54
59
tmp_path .joinpath ('index.rst' ).write_text (
@@ -63,7 +68,7 @@ def test_move_module_targets_no_section(tmp_path):
63
68
64
69
65
70
@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 :
67
72
# Test for the MoveModuleTargets transform
68
73
tmp_path .joinpath ('conf.py' ).touch ()
69
74
tmp_path .joinpath ('index.rst' ).write_text (CONTENT_PY , encoding = 'utf-8' )
0 commit comments