docs: output generated sources under docs/lib and docs/mcp

This commit is contained in:
2026-09-10 21:11:30 +05:30
parent d4b79cf95a
commit a1c5f046d4
6 changed files with 26 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ def test_mcp_build(cli_runner):
(pkg / "__init__.py").write_text("")
(pkg / "mod.py").write_text("def f(): ...\n")
out_dir = cwd / "mcp_docs"
out_dir = cwd / "docs" / "mcp"
result = cli_runner.invoke(
cli,
@@ -20,8 +20,6 @@ def test_mcp_build(cli_runner):
"--mcp",
"--module",
"testpkg",
"--out-dir",
str(out_dir),
],
)

View File

@@ -33,8 +33,6 @@ def test_mkdocs_build_full_flow(
"testpkg",
"--site-name",
"Test Site",
"--docs-dir",
"docs",
"--mkdocs-yml",
"mkdocs.yml",
],
@@ -43,7 +41,8 @@ def test_mkdocs_build_full_flow(
assert result.exit_code == 0
assert mock_mkdocs_build() is True
assert (cwd / "mkdocs.yml").exists()
assert (cwd / "docs" / "testpkg" / "mod.md").exists()
assert (cwd / "docs" / "lib" / "testpkg" / "mod.md").exists()
assert "docs_dir: docs/lib" in (cwd / "mkdocs.yml").read_text()
def test_mkdocs_build_missing_module_fails(cli_runner):
@@ -81,8 +80,6 @@ def test_mkdocs_build_without_site_name_uses_module_as_default_full_flow(
"--mkdocs",
"--module",
"testpkg",
"--docs-dir",
"docs",
"--mkdocs-yml",
"mkdocs.yml",
],
@@ -99,5 +96,5 @@ def test_mkdocs_build_without_site_name_uses_module_as_default_full_flow(
content = mkdocs_yml.read_text()
assert "site_name: testpkg" in content
# Docs must be generated
assert (cwd / "docs" / "testpkg" / "mod.md").exists()
# Docs must be generated under the nested docs/lib dir
assert (cwd / "docs" / "lib" / "testpkg" / "mod.md").exists()