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_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-directivesrewrites 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=Trueskips 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.tomlthe update script rewrote is reformatted, and only it.A
pyproject.tomlthe run left alone keeps its drift: that one belongs to theformat-pyprojectjob.
- tests.test_docs.test_update_docs_leaves_an_unchanged_pyproject_alone(tmp_path, monkeypatch)[source]¶
A run that changed no
pyproject.tomlreformats 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_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-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.