mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix our test failed with pygments-2.7.0
Since pygments-2.7.0, it has changed the style of output HTML. That makes our test broken. This fixes it to pass with new pygments.
This commit is contained in:
parent
fabe685638
commit
85b24a2e88
@ -10,8 +10,10 @@
|
||||
|
||||
import os
|
||||
import re
|
||||
from distutils.version import LooseVersion
|
||||
from itertools import cycle, chain
|
||||
|
||||
import pygments
|
||||
import pytest
|
||||
from html5lib import HTMLParser
|
||||
|
||||
@ -1591,4 +1593,8 @@ def test_html_codeblock_linenos_style_inline(app):
|
||||
app.build()
|
||||
content = (app.outdir / 'index.html').read_text()
|
||||
|
||||
assert '<span class="lineno">1 </span>' in content
|
||||
pygments_version = tuple(LooseVersion(pygments.__version__).version)
|
||||
if pygments_version > (2, 7):
|
||||
assert '<span class="linenos">1</span>' in content
|
||||
else:
|
||||
assert '<span class="lineno">1 </span>' in content
|
||||
|
Loading…
Reference in New Issue
Block a user