summaryrefslogtreecommitdiffstats
path: root/tests/test_docutilsconf.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 11:31:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 11:31:33 +0000
commite863fd965dd6253243c3342bd6f0adc4fc8aec4d (patch)
treea4c1b6491a82593950043c3f8b2530e80664d768 /tests/test_docutilsconf.py
parentInitial commit. (diff)
downloadsphinx-e863fd965dd6253243c3342bd6f0adc4fc8aec4d.tar.xz
sphinx-e863fd965dd6253243c3342bd6f0adc4fc8aec4d.zip
Adding upstream version 5.3.0.upstream/5.3.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_docutilsconf.py')
-rw-r--r--tests/test_docutilsconf.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_docutilsconf.py b/tests/test_docutilsconf.py
new file mode 100644
index 0000000..def6cb6
--- /dev/null
+++ b/tests/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,
+ docutilsconf=('[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"])])