diff options
Diffstat (limited to 'tests/test_intl.py')
-rw-r--r-- | tests/test_intl.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/tests/test_intl.py b/tests/test_intl.py index 00f599595..3a704fd7d 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', @@ -621,8 +622,11 @@ def test_html_meta(app): assert expected_expr in result expected_expr = '<meta content="I18N, SPHINX, MARKUP" name="keywords" />' assert expected_expr in result - expected_expr = '<p class="caption"><span class="caption-text">HIDDEN TOC</span></p>' - assert expected_expr in result + if docutils.__version_info__ < (0, 17): + expected_expr = '<p class="caption"><span class="caption-text">HIDDEN TOC</span></p>' + assert expected_expr in result + else: + expected_expr = '<p><span class="caption-text">HIDDEN TOC</span></p>' @sphinx_intl @@ -1083,8 +1087,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 +1165,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] |