1414 from pathlib import Path
1515
1616 from mkdocs import config
17- from mkdocstrings_handlers .python . handler import PythonHandler
17+ from mkdocstrings_handlers .python import PythonHandler
1818
1919
2020@pytest .fixture (name = "mkdocs_conf" )
2121def fixture_mkdocs_conf (request : pytest .FixtureRequest , tmp_path : Path ) -> Iterator [config .Config ]:
2222 """Yield a MkDocs configuration object."""
2323 conf = MkDocsConfig ()
2424 while hasattr (request , "_parent_request" ) and hasattr (request ._parent_request , "_parent_request" ):
25- request = request ._parent_request
25+ request = request ._parent_request # ty: ignore[invalid-assignment]
2626
2727 conf_dict = {
2828 "site_name" : "foo" ,
@@ -32,7 +32,7 @@ def fixture_mkdocs_conf(request: pytest.FixtureRequest, tmp_path: Path) -> Itera
3232 ** getattr (request , "param" , {}),
3333 }
3434 # Re-create it manually as a workaround for https://github.com/mkdocs/mkdocs/issues/2289
35- mdx_configs : dict [str , Any ] = dict (ChainMap (* conf_dict .get ("markdown_extensions" , [])))
35+ mdx_configs : dict [str , Any ] = dict (ChainMap (* conf_dict .get ("markdown_extensions" , []))) # ty: ignore[invalid-argument-type]
3636
3737 conf .load_dict (conf_dict )
3838 assert conf .validate () == ([], [])
@@ -49,7 +49,7 @@ def fixture_mkdocs_conf(request: pytest.FixtureRequest, tmp_path: Path) -> Itera
4949@pytest .fixture (name = "python_handler" )
5050def fixture_python_handler (mkdocs_conf : MkDocsConfig ) -> PythonHandler :
5151 """Return a PythonHandler instance."""
52- handlers = mkdocs_conf .plugins ["mkdocstrings" ].handlers # type : ignore[attr-defined ]
52+ handlers = mkdocs_conf .plugins ["mkdocstrings" ].handlers # ty : ignore[possibly-missing-attribute ]
5353 handler = handlers .get_handler ("python" )
5454 handler ._update_env (md = Markdown (extensions = ["toc" ]))
5555 handler .env .filters ["convert_markdown" ] = lambda * args , ** kwargs : str (args ) + str (kwargs )
0 commit comments