From 5bb0bb4be543fd5eca41673696a62ed80d493591 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 5 Jun 2024 18:20:58 +0200 Subject: Adding upstream version 7.3.7. Signed-off-by: Daniel Baumann --- tests/test_writers/test_docutilsconf.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/test_writers/test_docutilsconf.py (limited to 'tests/test_writers/test_docutilsconf.py') diff --git a/tests/test_writers/test_docutilsconf.py b/tests/test_writers/test_docutilsconf.py new file mode 100644 index 0000000..6422c30 --- /dev/null +++ b/tests/test_writers/test_docutilsconf.py @@ -0,0 +1,29 @@ +"""Test docutils.conf support for several writers.""" + +import pytest +from docutils import nodes + +from sphinx.testing.util import assert_node +from sphinx.util.docutils import patch_docutils + + +@pytest.mark.sphinx('dummy', testroot='docutilsconf', freshenv=True) +def test_html_with_default_docutilsconf(app, status, warning): + with patch_docutils(app.confdir): + app.build() + + doctree = app.env.get_doctree('index') + assert_node(doctree[0][1], [nodes.paragraph, ("Sphinx ", + [nodes.footnote_reference, "1"])]) + + +@pytest.mark.sphinx('dummy', testroot='docutilsconf', freshenv=True, + docutils_conf=('[restructuredtext parser]\n' + 'trim_footnote_reference_space: true\n')) +def test_html_with_docutilsconf(app, status, warning): + with patch_docutils(app.confdir): + app.build() + + doctree = app.env.get_doctree('index') + assert_node(doctree[0][1], [nodes.paragraph, ("Sphinx", + [nodes.footnote_reference, "1"])]) -- cgit v1.2.3