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><a href="missing.html"></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
hrefthat 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.