Skip to content

Commit caf2fff

Browse files
committed
tests: Simplify the test that disables the plugin
1 parent 94d8299 commit caf2fff

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

tests/test_plugin.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,20 @@ def test_disabling_plugin(tmp_path: Path) -> None:
2020
docs_dir.mkdir()
2121
site_dir.mkdir()
2222
docs_dir.joinpath("index.md").write_text("::: mkdocstrings")
23+
config_file = tmp_path / "mkdocs.yml"
24+
config_file.write_text(
25+
"""
26+
site_name: Test
27+
theme: mkdocs
28+
plugins:
29+
- mkdocstrings:
30+
enabled: false
31+
"""
32+
)
2333

24-
mkdocs_config = load_config()
34+
mkdocs_config = load_config(str(config_file))
2535
mkdocs_config["docs_dir"] = str(docs_dir)
2636
mkdocs_config["site_dir"] = str(site_dir)
27-
mkdocs_config["plugins"]["mkdocstrings"].config["enabled"] = False
2837
mkdocs_config["plugins"].run_event("startup", command="build", dirty=False)
2938
try:
3039
build(mkdocs_config)

0 commit comments

Comments
 (0)