2013-07-27 00:13:15 -05:00
|
|
|
"""
|
|
|
|
test_docutilsconf
|
|
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Test docutils.conf support for several writers.
|
|
|
|
|
2019-12-31 23:27:43 -06:00
|
|
|
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
|
2013-07-27 00:13:15 -05:00
|
|
|
:license: BSD, see LICENSE for details.
|
|
|
|
"""
|
|
|
|
|
2017-01-05 10:14:47 -06:00
|
|
|
import pytest
|
2019-02-08 09:36:25 -06:00
|
|
|
from docutils import nodes
|
2018-02-19 07:39:14 -06:00
|
|
|
|
2019-02-08 09:36:25 -06:00
|
|
|
from sphinx.testing.util import assert_node
|
2018-03-29 08:45:20 -05:00
|
|
|
from sphinx.util.docutils import patch_docutils
|
2013-07-27 00:13:15 -05:00
|
|
|
|
|
|
|
|
2019-02-08 23:44:37 -06:00
|
|
|
@pytest.mark.sphinx('dummy', testroot='docutilsconf', freshenv=True)
|
2014-09-21 10:17:02 -05:00
|
|
|
def test_html_with_default_docutilsconf(app, status, warning):
|
2018-03-29 08:45:20 -05:00
|
|
|
with patch_docutils(app.confdir):
|
2019-02-08 09:36:25 -06:00
|
|
|
app.build()
|
2018-03-29 08:45:20 -05:00
|
|
|
|
2019-02-08 09:36:25 -06:00
|
|
|
doctree = app.env.get_doctree('index')
|
|
|
|
assert_node(doctree[0][1], [nodes.paragraph, ("Sphinx ",
|
|
|
|
[nodes.footnote_reference, "1"])])
|
2013-07-27 00:13:15 -05:00
|
|
|
|
|
|
|
|
2019-02-08 23:44:37 -06:00
|
|
|
@pytest.mark.sphinx('dummy', testroot='docutilsconf', freshenv=True,
|
2019-02-08 09:36:25 -06:00
|
|
|
docutilsconf=('[restructuredtext parser]\n'
|
|
|
|
'trim_footnote_reference_space: true\n'))
|
2014-09-21 10:17:02 -05:00
|
|
|
def test_html_with_docutilsconf(app, status, warning):
|
2018-03-29 08:45:20 -05:00
|
|
|
with patch_docutils(app.confdir):
|
2019-02-08 09:36:25 -06:00
|
|
|
app.build()
|
2013-07-27 00:13:15 -05:00
|
|
|
|
2019-02-08 09:36:25 -06:00
|
|
|
doctree = app.env.get_doctree('index')
|
|
|
|
assert_node(doctree[0][1], [nodes.paragraph, ("Sphinx",
|
|
|
|
[nodes.footnote_reference, "1"])])
|