From 9f6ca0fe15a1f01ad2960648fc1e9d2d5a5cdb9e Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 21 Jan 2016 01:46:51 +0100 Subject: pythonPackages.sphinx: fix tests with Pygments 2.1 Close #12511. --- .../sphinx-fix-tests-with-pygments-2.1.patch | 63 ++++++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 64 insertions(+) create mode 100644 pkgs/development/python-modules/sphinx-fix-tests-with-pygments-2.1.patch diff --git a/pkgs/development/python-modules/sphinx-fix-tests-with-pygments-2.1.patch b/pkgs/development/python-modules/sphinx-fix-tests-with-pygments-2.1.patch new file mode 100644 index 000000000000..5aa4af873cd5 --- /dev/null +++ b/pkgs/development/python-modules/sphinx-fix-tests-with-pygments-2.1.patch @@ -0,0 +1,63 @@ +From 5574aba60ed76f2bae947722122ac4d71ab8ed5a Mon Sep 17 00:00:00 2001 +From: Takeshi KOMIYA +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 = """#include <stdio.h>""" ++ expected_expr = ("""#include """ ++ """<stdio.h>""") + yield assert_count(expected_expr, result, 1) + + # doctest block should not be translated but be highlighted + expected_expr = ( + """>>> """ + """import sys """ +- """# sys importing""") ++ """# sys importing""") + 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 = """#include <STDIO.H>""" ++ expected_expr = ("""#include """ ++ """<STDIO.H>""") + yield assert_count(expected_expr, result, 1) + + # doctest block should not be translated but be highlighted + expected_expr = ( + """>>> """ + """import sys """ +- """# SYS IMPORTING""") ++ """# SYS IMPORTING""") + yield assert_count(expected_expr, result, 1) + + ## raw.txt diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fc041acd47dd..5739de28ddf2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -18910,6 +18910,7 @@ in modules // { sha256 = "0mw06q7bzzjylgwh0wnnaxmwc95hx8w95as4vcgpan579brw7b4a"; }; + patches = [ ../development/python-modules/sphinx-fix-tests-with-pygments-2.1.patch ]; LC_ALL = "en_US.UTF-8"; checkPhase = '' PYTHON=${python.executable} make test -- cgit 1.4.1