tests.sphinx.test_sphinx_fail_on_warnings moduleΒΆ

Tests for failing a Sphinx build on the warning types a project lists.

tests.sphinx.test_sphinx_fail_on_warnings.DEAD_LABEL_PAGE = 'Orchard\n=======\n\nSee :ref:`the-walled-garden`.\n'ΒΆ

A reStructuredText page whose one defect is an undefined label: ref.ref.

tests.sphinx.test_sphinx_fail_on_warnings.CLEAN_PAGE = 'Orchard\n=======\n\nApples ripen in autumn.\n'ΒΆ

The same page, without the defect.

tests.sphinx.test_sphinx_fail_on_warnings.DEAD_FRAGMENT_PAGE = '# Orchard\n\nSee [the walled garden](#the-walled-garden).\n'ΒΆ

A MyST page whose one defect is a link to no anchor: myst.xref_missing.

tests.sphinx.test_sphinx_fail_on_warnings.build(tmp_path, page, *, listed=None, suppressed=None, suffix='.rst')[source]ΒΆ

Build a one-page project, and return its exit status and warning stream.

tests.sphinx.test_sphinx_fail_on_warnings.test_listed_types_decide_the_exit_status(tmp_path, listed, suppressed, status)[source]ΒΆ

A warning fails the build only when its type is listed and not suppressed.

tests.sphinx.test_sphinx_fail_on_warnings.test_clean_build_passes(tmp_path)[source]ΒΆ

A listed type fails nothing while no warning of that type is logged.

tests.sphinx.test_sphinx_fail_on_warnings.test_error_counts_each_warning_once(tmp_path)[source]ΒΆ

The error names the matched type, and counts a replayed warning once.

tests.sphinx.test_sphinx_fail_on_warnings.test_dead_myst_fragment_fails_the_build(tmp_path)[source]ΒΆ

The case the hook was written for: a `text <#anchor>`_ link to nothing.

tests.sphinx.test_sphinx_fail_on_warnings.test_collector_does_not_outlive_its_build(tmp_path)[source]ΒΆ

The collector leaves the sphinx logger once its build is over.

A second build cannot tell: creating its app clears every handler of that logger, a collector left behind included.