summaryrefslogtreecommitdiff
path: root/tests/test_intl.py
diff options
context:
space:
mode:
authorAdam Turner <9087854+aa-turner@users.noreply.github.com>2023-01-01 19:17:03 +0000
committerAdam Turner <9087854+aa-turner@users.noreply.github.com>2023-01-01 19:17:03 +0000
commit965768bfda2a00ba6466cdb12a7a46efdce47023 (patch)
tree48f46b00160ced9ae6d41a2c6a6ba8adb2c8cbda /tests/test_intl.py
parent5715abf1d4c6b1ae674595250dd1a294e4a59a85 (diff)
downloadsphinx-git-965768bfda2a00ba6466cdb12a7a46efdce47023.tar.gz
Fix tests for Pygments 2.14
Pygments 2.14 was released on 01/01/2023 [0] [0]: https://pygments.org/docs/changelog/#version-2-14-0
Diffstat (limited to 'tests/test_intl.py')
-rw-r--r--tests/test_intl.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_intl.py b/tests/test_intl.py
index efe6c9bce..07dfe8be3 100644
--- a/tests/test_intl.py
+++ b/tests/test_intl.py
@@ -6,6 +6,7 @@ Runs the text builder in the test root.
import os
import re
+import pygments
import pytest
from babel.messages import mofile, pofile
from babel.messages.catalog import Catalog
@@ -1104,8 +1105,11 @@ def test_additional_targets_should_not_be_translated(app):
expected_expr = ("""<span class="n">literal</span>"""
"""<span class="o">-</span>"""
"""<span class="n">block</span>\n"""
- """<span class="k">in</span> """
+ """<span class="k">in</span>"""
+ """<span class="w"> </span>"""
"""<span class="n">list</span>""")
+ if pygments.__version__ < '2.14.0':
+ expected_expr = expected_expr.replace("""<span class="w"> </span>""", ' ')
assert_count(expected_expr, result, 1)
# doctest block should not be translated but be highlighted
@@ -1179,8 +1183,11 @@ def test_additional_targets_should_be_translated(app):
expected_expr = ("""<span class="no">LITERAL</span>"""
"""<span class="o">-</span>"""
"""<span class="no">BLOCK</span>\n"""
- """<span class="no">IN</span> """
+ """<span class="no">IN</span>"""
+ """<span class="w"> </span>"""
"""<span class="no">LIST</span>""")
+ if pygments.__version__ < '2.14.0':
+ expected_expr = expected_expr.replace("""<span class="w"> </span>""", ' ')
assert_count(expected_expr, result, 1)
# doctest block should not be translated but be highlighted