tests.test_docs module¶
Tests for the update-docs orchestration and this repository’s docs wiring.
- tests.test_docs.test_docs_group_carries_the_test_group()[source]¶
The Sphinx environment imports the test suite it documents.
autodoc imports every module it renders a page for,
docs/tests.mddocuments each test module, and each of those imports pytest. Without thetestgroup, all of them fail to import and their pages publish empty. The build reports that as a warning, so nothing else catches it.- Return type:
- tests.test_docs.test_validate_docs_script_path_empty_returns_none(tmp_path)[source]¶
An empty configured path disables the script phase.
- tests.test_docs.test_validate_docs_script_path_valid(tmp_path)[source]¶
A
.pyfile underdocs/resolves to its absolute path.
- tests.test_docs.test_validate_docs_script_path_rejects(tmp_path, script, match)[source]¶
Paths outside
docs/, outside the repo, or non-.pyare rejected.
- tests.test_docs.test_run_docs_tool_builds_frozen_docs_group_command()[source]¶
The command runs the tool through a frozen uv with the
docsgroup.
- tests.test_docs.test_run_docs_tool_raises_on_failure()[source]¶
A non-zero exit code raises a
ClickExceptionnaming the phase.
- tests.test_docs.test_update_docs_noop_without_sphinx(tmp_path, monkeypatch)[source]¶
A project with no Sphinx configuration runs no docs tooling.
- tests.test_docs.test_update_docs_runs_apidoc_for_autodoc_project(tmp_path, monkeypatch)[source]¶
An autodoc-enabled Sphinx project regenerates its apidoc stubs.
- tests.test_docs.test_update_docs_skips_apidoc_without_active_autodoc(tmp_path, monkeypatch)[source]¶
Without an active autodoc extension, no docs tooling runs.
- tests.test_docs.test_update_docs_check_skips_writes_and_propagates(tmp_path, monkeypatch)[source]¶
check=Trueskips the write phases and runs the rest in check mode.
- tests.test_docs.test_update_docs_check_raises_on_drift(tmp_path, monkeypatch)[source]¶
A non-zero exit from a check phase raises with an “out of date” message.
- tests.test_docs.test_wire_api_pages_inserts_a_missing_entry(tmp_path)[source]¶
A generated page absent from its parent toctree is listed, in order.
sphinx-apidoc --no-tocwrites the page and no index entry, so a module added after the index was last written builds while Sphinx only warnsdocument isn't included in any toctree. meta-package-manager hit this whentests.test_sbom_baselanded: its page shipped orphaned and the conformance test guarding the roster turned every cell of its test matrix red.
- tests.test_docs.test_wire_api_pages_is_idempotent(tmp_path)[source]¶
A second pass over a wired tree rewrites nothing.
- tests.test_docs.test_wire_api_pages_sorts_a_subpackage_into_its_own_toctree(tmp_path)[source]¶
An index page joins
Subpackages, a plain module joinsSubmodules.
- tests.test_docs.test_wire_api_pages_reports_an_index_missing_its_section(tmp_path)[source]¶
A page is left alone, and named, when its index carries no such toctree.