summary refs log tree commit diff
path: root/pkgs/development/python-modules/sphinx-fix-tests-with-pygments-2.1.patch
blob: 5aa4af873cd53404727e2f3db74361dc2832588a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From 5574aba60ed76f2bae947722122ac4d71ab8ed5a Mon Sep 17 00:00:00 2001
From: Takeshi KOMIYA <i.tkomiya@gmail.com>
Date: Mon, 18 Jan 2016 12:38:02 +0900
Subject: [PATCH] Fix tests are broken with pygments-2.1

---
 tests/test_build_html.py |  2 +-
 tests/test_intl.py       | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index e330761..17ea089 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -82,7 +82,7 @@ def checker(nodes):
         (".//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",
diff --git a/tests/test_intl.py b/tests/test_intl.py
index 4c665d4..b24ec65 100644
--- a/tests/test_intl.py
+++ b/tests/test_intl.py
@@ -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