sphinx/tests/test_writers/test_docutilsconf.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
1.0 KiB
Python
Raw Normal View History

"""Test docutils.conf support for several writers."""
import pytest
from docutils import nodes
2018-02-19 07:39:14 -06:00
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):
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,
2024-01-16 20:38:46 -06:00
docutils_conf=('[restructuredtext parser]\n'
'trim_footnote_reference_space: true\n'))
def test_html_with_docutilsconf(app):
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"])])