summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-02-12 09:25:23 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-04-03 23:54:19 +0900
commit84b9d49826769c7d36f0399ee01777fd5bb8a209 (patch)
tree98080c0b1d4324c0975808c2076e35946884d147
parent6e438af6c030b8ebe74330bec0a03de2d45dd752 (diff)
downloadsphinx-git-84b9d49826769c7d36f0399ee01777fd5bb8a209.tar.gz
test: Update testcase for docutils-0.17 (<section>)
Since v0.17, docutils starts to use <section> for section on HTML output. This modifies the expected value of our testcases to support it.
-rw-r--r--tests/test_intl.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/test_intl.py b/tests/test_intl.py
index 00f599595..0e4387025 100644
--- a/tests/test_intl.py
+++ b/tests/test_intl.py
@@ -20,6 +20,7 @@ from docutils import nodes
from sphinx import locale
from sphinx.testing.util import (assert_node, assert_not_re_search, assert_re_search,
assert_startswith, etree_parse, path, strip_escseq)
+from sphinx.util import docutils
sphinx_intl = pytest.mark.sphinx(
testroot='intl',
@@ -1083,8 +1084,12 @@ def test_additional_targets_should_not_be_translated(app):
result = (app.outdir / 'raw.html').read_text()
# raw block should not be translated
- expected_expr = """<iframe src="http://sphinx-doc.org"></iframe></div>"""
- assert_count(expected_expr, result, 1)
+ if docutils.__version_info__ < (0, 17):
+ expected_expr = """<iframe src="http://sphinx-doc.org"></iframe></div>"""
+ assert_count(expected_expr, result, 1)
+ else:
+ expected_expr = """<iframe src="http://sphinx-doc.org"></iframe></section>"""
+ assert_count(expected_expr, result, 1)
# [figure.txt]
@@ -1157,8 +1162,12 @@ def test_additional_targets_should_be_translated(app):
result = (app.outdir / 'raw.html').read_text()
# raw block should be translated
- expected_expr = """<iframe src="HTTP://SPHINX-DOC.ORG"></iframe></div>"""
- assert_count(expected_expr, result, 1)
+ if docutils.__version_info__ < (0, 17):
+ expected_expr = """<iframe src="HTTP://SPHINX-DOC.ORG"></iframe></div>"""
+ assert_count(expected_expr, result, 1)
+ else:
+ expected_expr = """<iframe src="HTTP://SPHINX-DOC.ORG"></iframe></section>"""
+ assert_count(expected_expr, result, 1)
# [figure.txt]