tests.sphinx.test_sphinx_manpages module¶
Tests for click_extra.sphinx.manpages.
- tests.sphinx.test_sphinx_manpages.test_manpages_hook_writes_tree_into_outdir(tmp_path)[source]¶
An entry with just
scriptwrites the whole tree underman/.
- tests.sphinx.test_sphinx_manpages.test_manpages_hook_honors_prog_name_and_output_dir(tmp_path)[source]¶
An entry can override both the basename and the subdirectory.
- tests.sphinx.test_sphinx_manpages.test_manpages_hook_skips_non_html_builder(tmp_path)[source]¶
Non-HTML builders (like
linkcheck) must not emit man pages.
- tests.sphinx.test_sphinx_manpages.test_manpages_hook_empty_config_is_noop(tmp_path)[source]¶
An empty list leaves the build untouched.
- tests.sphinx.test_sphinx_manpages.test_manpages_hook_skips_entry_without_script(tmp_path)[source]¶
An entry missing
scriptis skipped (logged as a warning) instead of aborting the build.
- tests.sphinx.test_sphinx_manpages.test_manpages_module_help_documents_config_shape()[source]¶
The module docstring spells out every supported key.
A safety net against silent removal: distributors and downstream projects depend on the docstring as the canonical reference, since it is what
help(click_extra.sphinx.manpages)prints.
- tests.sphinx.test_sphinx_manpages.test_manpages_hook_emits_html_siblings(tmp_path)[source]¶
When a renderer is available, every
.1gets a.1.htmlnext to it whose body carries the section headings from the source roff.
- tests.sphinx.test_sphinx_manpages.test_manpages_hook_respects_render_html_opt_out(tmp_path)[source]¶
render_html=Falseskips the HTML pass even when a renderer is present, keeping the build to roff only.
- tests.sphinx.test_sphinx_manpages.test_manpages_directive_renders_one_link_per_command(tmp_path)[source]¶
The directive emits a bullet list with one entry per (sub)command of every script declared in
click_extra_manpages.
- tests.sphinx.test_sphinx_manpages.test_manpages_directive_links_are_ignored_by_linkcheck(tmp_path)[source]¶
linkcheckignores the links of the index instead of reporting them broken.Only an HTML build writes the pages they point at, while
linkchecklooks for a relative link in the source tree, where those pages never are.
- tests.sphinx.test_sphinx_manpages.test_manpages_directive_links_follow_the_builder_layout(tmp_path, builder, page_file, prefix)[source]¶
Links resolve from wherever the builder publishes the page.
A second builder reusing pickled doctrees still gets its own layout.
Sphinx does not invalidate its doctree cache when the builder changes, so the directive never re-runs on the second pass. A link resolved at parse time would keep the first builder’s layout and point at nothing.