@@ -54,7 +54,7 @@ def make_sphinx_app(
5454
5555 def _factory (mapping : dict [str , str ]) -> SphinxTestApp :
5656 (docs_dir / "conf.py" ).write_text (
57- f 'extensions = ["score_any_folder"]\n '
57+ 'extensions = ["score_any_folder"]\n '
5858 f"score_any_folder_mapping = { mapping !r} \n "
5959 )
6060 (docs_dir / "index.rst" ).write_text ("Root\n ====\n " )
@@ -69,7 +69,9 @@ def _factory(mapping: dict[str, str]) -> SphinxTestApp:
6969
7070
7171def test_symlink_exposes_files_at_target_path (
72- make_sphinx_app : Callable , docs_dir : Path , tmp_path : Path
72+ make_sphinx_app : Callable [[dict [str , str ]], SphinxTestApp ],
73+ docs_dir : Path ,
74+ tmp_path : Path ,
7375) -> None :
7476 """Files in the source directory are readable via the symlinked target path."""
7577 src_docs = tmp_path / "src" / "module_docs"
@@ -83,7 +85,9 @@ def test_symlink_exposes_files_at_target_path(
8385
8486
8587def test_symlink_is_idempotent (
86- make_sphinx_app : Callable , docs_dir : Path , tmp_path : Path
88+ make_sphinx_app : Callable [[dict [str , str ]], SphinxTestApp ],
89+ docs_dir : Path ,
90+ tmp_path : Path ,
8791) -> None :
8892 """Build cleanup removes temporary links and a second build still succeeds."""
8993 src_docs = tmp_path / "external"
@@ -99,7 +103,9 @@ def test_symlink_is_idempotent(
99103
100104
101105def test_stale_symlink_is_replaced (
102- make_sphinx_app : Callable , docs_dir : Path , tmp_path : Path
106+ make_sphinx_app : Callable [[dict [str , str ]], SphinxTestApp ],
107+ docs_dir : Path ,
108+ tmp_path : Path ,
103109) -> None :
104110 """A symlink pointing to a stale target is replaced with the correct one."""
105111 correct_src = tmp_path / "correct"
@@ -114,21 +120,23 @@ def test_stale_symlink_is_replaced(
114120
115121
116122def test_existing_non_symlink_logs_error_and_skips (
117- make_sphinx_app : Callable , docs_dir : Path , tmp_path : Path
123+ make_sphinx_app : Callable [[dict [str , str ]], SphinxTestApp ],
124+ docs_dir : Path ,
125+ tmp_path : Path ,
118126) -> None :
119127 """A real directory at the target path is left untouched and an error is logged."""
120128 (tmp_path / "external" ).mkdir ()
121129 real_dir = docs_dir / "module"
122130 real_dir .mkdir ()
123131
124- app = make_sphinx_app ({"../external" : "module" })
132+ app : SphinxTestApp = make_sphinx_app ({"../external" : "module" })
125133
126134 assert real_dir .is_dir () and not real_dir .is_symlink ()
127135 assert "not a symlink" in app .warning .getvalue ()
128136
129137
130138def test_empty_mapping_is_a_no_op (
131- make_sphinx_app : Callable , docs_dir : Path
139+ make_sphinx_app : Callable [[ dict [ str , str ]], SphinxTestApp ] , docs_dir : Path
132140) -> None :
133141 """An empty mapping produces no symlinks and no errors."""
134142 make_sphinx_app ({}).build ()
@@ -137,7 +145,9 @@ def test_empty_mapping_is_a_no_op(
137145
138146
139147def test_multiple_mappings (
140- make_sphinx_app : Callable , docs_dir : Path , tmp_path : Path
148+ make_sphinx_app : Callable [[dict [str , str ]], SphinxTestApp ],
149+ docs_dir : Path ,
150+ tmp_path : Path ,
141151) -> None :
142152 """Multiple mapping entries each produce their own symlink."""
143153 for name in ("alpha" , "beta" ):
@@ -152,7 +162,9 @@ def test_multiple_mappings(
152162
153163
154164def test_target_in_subfolder (
155- make_sphinx_app : Callable , docs_dir : Path , tmp_path : Path
165+ make_sphinx_app : Callable [[dict [str , str ]], SphinxTestApp ],
166+ docs_dir : Path ,
167+ tmp_path : Path ,
156168) -> None :
157169 """A target path with intermediate directories creates the parent dirs."""
158170 src_docs = tmp_path / "external"
0 commit comments