From 55fb694739c942927f416ee38f2f7759cfebd830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Lang?= Date: Sat, 15 Aug 2020 23:34:25 -0300 Subject: [PATCH] pythonPackages.Nikola: fix tests - Use "pytest tests/" instead of "pytest ." to fix a relative import error - Apply a patch to fix markdown compilation tests - Remove a patch to requirements.txt not needed anymore --- .../python-modules/Nikola/default.nix | 9 +++---- .../Nikola/fix_markdown_test.patch | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/python-modules/Nikola/fix_markdown_test.patch diff --git a/pkgs/development/python-modules/Nikola/default.nix b/pkgs/development/python-modules/Nikola/default.nix index 31915383275bf..a45b6d59c807c 100644 --- a/pkgs/development/python-modules/Nikola/default.nix +++ b/pkgs/development/python-modules/Nikola/default.nix @@ -57,14 +57,11 @@ buildPythonPackage rec { sha256 = "2e5c8305ec4423b56af2223336c3309e5c9b8c96df0d6fde46d26cff4c5d6f1a"; }; - patchPhase = '' - # upstream added bound so that requires.io doesn't send mails about update - # nikola should work with markdown 3.0: https://github.com/getnikola/nikola/pull/3175#issue-220147596 - sed -i 's/Markdown>.*/Markdown/' requirements.txt - ''; + # Remove this patch when upgrading to Nikola>=8.1.0 + patches = [ ./fix_markdown_test.patch ]; checkPhase = '' - LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" py.test . + LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" py.test tests/ ''; meta = { diff --git a/pkgs/development/python-modules/Nikola/fix_markdown_test.patch b/pkgs/development/python-modules/Nikola/fix_markdown_test.patch new file mode 100644 index 0000000000000..b9bbfe01a2702 --- /dev/null +++ b/pkgs/development/python-modules/Nikola/fix_markdown_test.patch @@ -0,0 +1,25 @@ +From 226e8a726e85525fb22664d9d76f4fe1729cf51d Mon Sep 17 00:00:00 2001 +From: Chris Warrick +Date: Fri, 7 Feb 2020 18:00:04 +0100 +Subject: [PATCH] Update tests for Markdown==3.2 output change + +This minor change does not affect the appearance of Nikola's output. +--- + tests/test_compile_markdown.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_compile_markdown.py b/tests/test_compile_markdown.py +index 4d0e3d89c..88ac290d0 100644 +--- a/tests/test_compile_markdown.py ++++ b/tests/test_compile_markdown.py +@@ -31,8 +31,8 @@ +
\ +
1
\ +
\
+-from this
+-
++from this ++ +
+ """, + id="hilite",