diff options
Diffstat (limited to 'tests/test_build_html.py')
-rw-r--r-- | tests/test_build_html.py | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/tests/test_build_html.py b/tests/test_build_html.py index 2b74690a1..8fd83b438 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -6,10 +6,8 @@ from itertools import chain, cycle from unittest.mock import ANY, call, patch import docutils -import pygments import pytest from html5lib import HTMLParser -from packaging import version from sphinx.builders.html import validate_html_extra_path, validate_html_static_path from sphinx.errors import ConfigError @@ -23,9 +21,6 @@ else: FIGURE_CAPTION = ".//figure/figcaption/p" -PYGMENTS_VERSION = version.parse(pygments.__version__).release - - ENV_WARNINGS = """\ %(root)s/autodoc_fodder.py:docstring of autodoc_fodder.MarkupError:\\d+: \ WARNING: Explicit markup ends without a blank line; unexpected unindent. @@ -1631,13 +1626,10 @@ def test_html_codeblock_linenos_style_table(app): app.build() content = (app.outdir / 'index.html').read_text(encoding='utf8') - if PYGMENTS_VERSION >= (2, 8): - assert ('<div class="linenodiv"><pre><span class="normal">1</span>\n' - '<span class="normal">2</span>\n' - '<span class="normal">3</span>\n' - '<span class="normal">4</span></pre></div>') in content - else: - assert '<div class="linenodiv"><pre>1\n2\n3\n4</pre></div>' in content + assert ('<div class="linenodiv"><pre><span class="normal">1</span>\n' + '<span class="normal">2</span>\n' + '<span class="normal">3</span>\n' + '<span class="normal">4</span></pre></div>') in content @pytest.mark.sphinx('html', testroot='reST-code-block', @@ -1646,10 +1638,7 @@ def test_html_codeblock_linenos_style_inline(app): app.build() content = (app.outdir / 'index.html').read_text(encoding='utf8') - if PYGMENTS_VERSION > (2, 7): - assert '<span class="linenos">1</span>' in content - else: - assert '<span class="lineno">1 </span>' in content + assert '<span class="linenos">1</span>' in content @pytest.mark.sphinx('html', testroot='highlight_options') |