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.md documents each test module, and each of those imports pytest. Without the test group, 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:

None

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 .py file under docs/ 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-.py are 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 docs group.

tests.test_docs.test_run_docs_tool_returns_the_exit_code()[source]

A non-zero exit code comes back for the phase to judge.

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_stops_at_the_first_failed_phase(tmp_path, monkeypatch)[source]

A failed phase leaves the phases after it unrun.

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_has_directive_block(tmp_path, text, expected)[source]

Every form click-extra refresh-directives rewrites marks its page.

tests.test_docs.test_directive_phase_names_every_block_family()[source]

The help of the refresh phase names each kind of block it refreshes.

tests.test_docs.test_update_docs_check_skips_writes_and_propagates(tmp_path, monkeypatch)[source]

check=True skips the write phases and runs the rest in check mode.

tests.test_docs.ORCHARD_PYPROJECT = '[project]\nname="orchard"\n'

An unformatted pyproject.toml, as a project’s docs update script leaves it.

tests.test_docs.test_update_docs_reformats_the_pyproject_its_script_changed(tmp_path, monkeypatch)[source]

A pyproject.toml the update script rewrote is reformatted, and only it.

A pyproject.toml the run left alone keeps its drift: that one belongs to the format-pyproject job.

tests.test_docs.test_update_docs_leaves_an_unchanged_pyproject_alone(tmp_path, monkeypatch)[source]

A run that changed no pyproject.toml reformats none.

tests.test_docs.test_update_docs_check_reports_drift(tmp_path, monkeypatch)[source]

A non-zero exit from a check phase is drift, not a failure.

tests.test_docs.test_cli_check_reports_the_drift_of_every_phase(monkeypatch, results, exit_code, output)[source]
tests.test_docs.test_cli_stops_on_a_failed_phase(monkeypatch)[source]
tests.test_docs.test_cli_help_lists_every_phase_on_its_own_line()[source]

The help comes from the phase registry, one numbered line per phase.

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-toc writes the page and no index entry, so a module added after the index was last written builds while Sphinx only warns document isn't included in any toctree. meta-package-manager hit this when tests.test_sbom_base landed: 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 joins Submodules.

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.

tests.test_docs.test_wire_api_pages_reads_a_myst_toctree_fence(tmp_path)[source]

A page listed in a native MyST toctree fence counts as wired.

The fence holds its entries at the margin, where the reST directive that click_extra wraps in an {eval-rst} block indents them.

tests.test_docs.test_wire_api_pages_lists_a_package_without_submodule_pages(tmp_path)[source]

A package page joins Subpackages even with no page below it.

Without --separate, sphinx-apidoc writes the modules of a package inline, so its title is all that tells a package page from a module page.