Fix tests are broken with pygments-2.1

This commit is contained in:
Takeshi KOMIYA 2016-01-18 12:38:02 +09:00
parent 34cbf3bad7
commit 5574aba60e
2 changed files with 7 additions and 5 deletions

View File

@ -82,7 +82,7 @@ HTML_XPATH = {
(".//a[@href='_downloads/img1.png']", ''),
(".//pre", u'"quotes"'),
(".//pre", u"'included'"),
(".//pre/span[@class='s']", u'üöä'),
(".//pre/span[@class='s2']", u'üöä'),
(".//div[@class='inc-pyobj1 highlight-text']//pre",
r'^class Foo:\n pass\n\s*$'),
(".//div[@class='inc-pyobj2 highlight-text']//pre",

View File

@ -694,14 +694,15 @@ def test_additional_targets_should_not_be_translated(app, status, warning):
yield assert_count(expected_expr, result, 1)
# C code block with lang should not be translated but be *C* highlighted
expected_expr = """<span class="cp">#include &lt;stdio.h&gt;</span>"""
expected_expr = ("""<span class="cp">#include</span> """
"""<span class="cpf">&lt;stdio.h&gt;</span>""")
yield assert_count(expected_expr, result, 1)
# doctest block should not be translated but be highlighted
expected_expr = (
"""<span class="gp">&gt;&gt;&gt; </span>"""
"""<span class="kn">import</span> <span class="nn">sys</span> """
"""<span class="c"># sys importing</span>""")
"""<span class="c1"># sys importing</span>""")
yield assert_count(expected_expr, result, 1)
## raw.txt
@ -754,14 +755,15 @@ def test_additional_targets_should_be_translated(app, status, warning):
yield assert_count(expected_expr, result, 1)
# C code block with lang should be translated and be *C* highlighted
expected_expr = """<span class="cp">#include &lt;STDIO.H&gt;</span>"""
expected_expr = ("""<span class="cp">#include</span> """
"""<span class="cpf">&lt;STDIO.H&gt;</span>""")
yield assert_count(expected_expr, result, 1)
# doctest block should not be translated but be highlighted
expected_expr = (
"""<span class="gp">&gt;&gt;&gt; </span>"""
"""<span class="kn">import</span> <span class="nn">sys</span> """
"""<span class="c"># SYS IMPORTING</span>""")
"""<span class="c1"># SYS IMPORTING</span>""")
yield assert_count(expected_expr, result, 1)
## raw.txt