Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Click Extra has been maintained for 5+ years, and is free to use. You can help if you 🀝 purchase business support or 🫢 sponsor the project.
Click Extra
Light Logo Dark Logo
  • Installation
  • Tutorial

Running and wrapping CLIs

  • CLI
  • Man pages
  • CLI wrapper

Building a CLI

  • Commands & groups
  • Decorators
  • Types
  • Context
  • Multicall binaries

Configuration

  • Configuration files
  • Configuration discovery
  • Configuration formats
  • Configuration schema
  • Configuration validation
  • Environment variables

Colors and output

  • Colored help
  • Themes
  • Styling
  • Layout
  • Table
  • Spinner

Runtime behavior

  • Logging
  • Execution
  • Version
  • Bug reports
  • Telemetry

Introspection and export

  • Parameters
  • Machine-readable help
  • Command tree
  • Carapace completion

Testing

  • CLI testing
  • Pytest
  • Test suites

Terminal captures

  • CLI screenshots
  • Code snippets
  • Man-page

Documenting a CLI

  • Sphinx
  • Python directives
  • MyST docstrings
  • Pygments
  • MkDocs

Comparisons

  • Typer compatibility
  • Benchmark

Contributing

  • Contribution guide
  • Downstream packaging
  • Binaries
  • Upstream
  • Code of conduct

API reference

  • click_extra package
    • click_extra.capture package
      • click_extra.capture.html module
      • click_extra.capture.presets module
      • click_extra.capture.recording module
      • click_extra.capture.screenshot module
      • click_extra.capture.snippet module
      • click_extra.capture.svg module
      • click_extra.capture.terminal module
    • click_extra.config package
      • click_extra.config.builtin module
      • click_extra.config.discovery module
      • click_extra.config.export module
      • click_extra.config.flags module
      • click_extra.config.formats module
      • click_extra.config.option module
      • click_extra.config.schema module
      • click_extra.config.subcommands module
    • click_extra.markdown package
      • click_extra.markdown.blocks module
      • click_extra.markdown.myst module
    • click_extra.sphinx package
      • click_extra.sphinx.announcement module
      • click_extra.sphinx.changelog module
      • click_extra.sphinx.click module
      • click_extra.sphinx.click_reference module
      • click_extra.sphinx.click_runner module
      • click_extra.sphinx.crosshair module
      • click_extra.sphinx.doctrees module
      • click_extra.sphinx.fail_on_warnings module
      • click_extra.sphinx.internal_links module
      • click_extra.sphinx.linkcheck module
      • click_extra.sphinx.manpages module
      • click_extra.sphinx.matrix module
      • click_extra.sphinx.mermaid module
      • click_extra.sphinx.myst_docstrings module
      • click_extra.sphinx.opengraph module
      • click_extra.sphinx.parallel module
      • click_extra.sphinx.python module
      • click_extra.sphinx.tables module
      • click_extra.sphinx.tabs module
      • click_extra.sphinx.theme_docs module
      • click_extra.sphinx.todos module
      • click_extra.sphinx.viewcode module
    • click_extra.accessibility module
    • click_extra.ansi module
    • click_extra.blocks module
    • click_extra.bug_report module
    • click_extra.carapace module
    • click_extra.cli module
    • click_extra.cli_capture module
    • click_extra.cli_prebake module
    • click_extra.cli_wrapper module
    • click_extra.color module
    • click_extra.columns module
    • click_extra.command_doc module
    • click_extra.commands module
    • click_extra.context module
    • click_extra.decorators module
    • click_extra.envvar module
    • click_extra.execution module
    • click_extra.highlight module
    • click_extra.humanize module
    • click_extra.jobs module
    • click_extra.layout module
    • click_extra.logging module
    • click_extra.logo module
    • click_extra.mkdocs module
    • click_extra.multicall module
    • click_extra.output module
    • click_extra.param_tools module
    • click_extra.parameters module
    • click_extra.prebake module
    • click_extra.progress module
    • click_extra.project module
    • click_extra.pygments module
    • click_extra.pytest module
    • click_extra.show_params module
    • click_extra.spinner module
    • click_extra.spinner_presets module
    • click_extra.styling module
    • click_extra.table module
    • click_extra.table_options module
    • click_extra.telemetry module
    • click_extra.test_suite module
    • click_extra.testing module
    • click_extra.theme module
    • click_extra.trail module
    • click_extra.tree module
    • click_extra.types module
    • click_extra.version module
    • click_extra.version_facts module
  • tests package
    • tests.mkdocs package
      • tests.mkdocs.conftest module
      • tests.mkdocs.test_mkdocs module
    • tests.sphinx package
      • tests.sphinx.conftest module
      • tests.sphinx.test_sphinx module
      • tests.sphinx.test_sphinx_announcement module
      • tests.sphinx.test_sphinx_changelog module
      • tests.sphinx.test_sphinx_click module
      • tests.sphinx.test_sphinx_click_config module
      • tests.sphinx.test_sphinx_click_tree module
      • tests.sphinx.test_sphinx_crosshair module
      • tests.sphinx.test_sphinx_doctrees module
      • tests.sphinx.test_sphinx_fail_on_warnings module
      • tests.sphinx.test_sphinx_internal_links module
      • tests.sphinx.test_sphinx_linkcheck module
      • tests.sphinx.test_sphinx_manpages module
      • tests.sphinx.test_sphinx_matrix module
      • tests.sphinx.test_sphinx_mermaid module
      • tests.sphinx.test_sphinx_myst_docstrings module
      • tests.sphinx.test_sphinx_opengraph module
      • tests.sphinx.test_sphinx_parallel module
      • tests.sphinx.test_sphinx_python module
      • tests.sphinx.test_sphinx_tables module
      • tests.sphinx.test_sphinx_tabs module
      • tests.sphinx.test_sphinx_todos module
      • tests.sphinx.test_sphinx_viewcode module
    • tests.conftest module
    • tests.tachyon_cast module
    • tests.test_accessibility module
    • tests.test_ansi module
    • tests.test_blocks module
    • tests.test_bug_report module
    • tests.test_carapace module
    • tests.test_cli_wrapper module
    • tests.test_color module
    • tests.test_command_doc module
    • tests.test_commands module
    • tests.test_config module
    • tests.test_config_discovery module
    • tests.test_config_flags module
    • tests.test_config_schema module
    • tests.test_context module
    • tests.test_docs_anchors module
    • tests.test_docs_api module
    • tests.test_docs_directives module
    • tests.test_envvar module
    • tests.test_execution module
    • tests.test_highlight module
    • tests.test_humanize module
    • tests.test_hygiene module
    • tests.test_jobs module
    • tests.test_layout module
    • tests.test_logging module
    • tests.test_logo module
    • tests.test_multicall module
    • tests.test_myst module
    • tests.test_output module
    • tests.test_parameters module
    • tests.test_prebake module
    • tests.test_progress module
    • tests.test_project module
    • tests.test_pygments module
    • tests.test_pyproject module
    • tests.test_pytest module
    • tests.test_readme module
    • tests.test_recording module
    • tests.test_screenshots module
    • tests.test_snippet module
    • tests.test_sphinx_crossrefs module
    • tests.test_spinner module
    • tests.test_styling module
    • tests.test_table module
    • tests.test_telemetry module
    • tests.test_terminal module
    • tests.test_test_suite module
    • tests.test_testing module
    • tests.test_theme module
    • tests.test_trail module
    • tests.test_tree module
    • tests.test_types module
    • tests.test_utils module
    • tests.test_version module
  • Index
  • Module Index

Project

  • Changelog
  • Todo list
  • License
  • GitHub repository
  • Funding
Back to top
View this page
Edit this page

tests.sphinx.test_sphinx_internal_links moduleΒΆ

Tests for the warning about each internal link of the built HTML that leads nowhere.

tests.sphinx.test_sphinx_internal_links.ORCHARD_PAGES = {'cellar/index.html': '<a href="../index.html#top">back</a>', 'fruits.html': '<h2 id="pears">Pears</h2>', 'index.html': '<p id="top"><a name="old"></a><a href="fruits.html">fruits</a><a href="fruits.html#pears">pears</a><a href="fruits.html#plums">plums</a><a href="missing.html">missing</a><a href="missing.html">missing again</a><a href="#top">top</a><a href="#old">old</a><a href="#">empty</a><a href="cellar/">cellar</a><a href="https://example.com/orchard.html#nowhere">external</a><a href="mailto:grower@example.com">mail</a><a href="/fruits.html#nowhere">root-relative</a><a href="../outside.html">outside</a><code>&lt;a href="missing.html"&gt;</code><span>href="text.html"</span></p>'}ΒΆ

Pages that hold two dead links among links of every kind the check skips.

The text that only looks like a link, inside <code> or as a bare string, is no <a> element, so it leads nowhere and gets no warning.

tests.sphinx.test_sphinx_internal_links.test_dead_links_finds_each_dead_target_once(tmp_path)[source]ΒΆ

Each href that leads to no page or no anchor is reported once per page.

tests.sphinx.test_sphinx_internal_links.write_project(srcdir, conf='')[source]ΒΆ

Write a project whose only page holds a raw HTML block of dead links.

tests.sphinx.test_sphinx_internal_links.test_build_warns_once_per_dead_link(tmp_path)[source]ΒΆ

A build warns once about each dead link of a page, with the warning type.

tests.sphinx.test_sphinx_internal_links.test_suppressed_warning_turns_the_check_off(tmp_path, suppressed)[source]ΒΆ

Listing the type in suppress_warnings, or its parent, silences the check.

Next
tests.sphinx.test_sphinx_linkcheck module
Previous
tests.sphinx.test_sphinx_fail_on_warnings module
Copyright © Kevin Deldycke and contributors
Made with Furo
Last updated on 2026-11-29
On this page
  • tests.sphinx.test_sphinx_internal_links module
    • ORCHARD_PAGES
    • test_dead_links_finds_each_dead_target_once()
    • write_project()
    • test_build_warns_once_per_dead_link()
    • test_suppressed_warning_turns_the_check_off()