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