guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: gnu: python-docopt: Fix test suite for pytest-6.


From: guix-commits
Subject: 01/02: gnu: python-docopt: Fix test suite for pytest-6.
Date: Mon, 9 Aug 2021 03:13:39 -0400 (EDT)

efraim pushed a commit to branch core-updates-frozen
in repository guix.

commit 23b9dadc1decd040713fb2a409a9d4384e225135
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Mon Aug 9 10:00:38 2021 +0300

    gnu: python-docopt: Fix test suite for pytest-6.
    
    * gnu/packages/python-xyz.scm (python-docopt)[source]: Add patch.
    * gnu/packages/patches/python-docopt-pytest6-compat.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Register it.
---
 gnu/local.mk                                       |  1 +
 .../patches/python-docopt-pytest6-compat.patch     | 29 ++++++++++++++++++++++
 gnu/packages/python-xyz.scm                        |  3 ++-
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index aec89e9..9ba2971 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1600,6 +1600,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/python-cross-compile.patch              \
   %D%/packages/patches/python2-larch-coverage-4.0a6-compatibility.patch \
   %D%/packages/patches/python-configobj-setuptools.patch       \
+  %D%/packages/patches/python-docopt-pytest6-compat.patch      \
   %D%/packages/patches/python-flask-restful-werkzeug-compat.patch      \
   %D%/packages/patches/python-keras-integration-test.patch     \
   %D%/packages/patches/python-pep8-stdlib-tokenize-compat.patch \
diff --git a/gnu/packages/patches/python-docopt-pytest6-compat.patch 
b/gnu/packages/patches/python-docopt-pytest6-compat.patch
new file mode 100644
index 0000000..acd4955
--- /dev/null
+++ b/gnu/packages/patches/python-docopt-pytest6-compat.patch
@@ -0,0 +1,29 @@
+https://sources.debian.org/data/main/d/docopt/0.6.2-3/debian/patches/pytest6
+
+From: Michael R. Crusoe <crusoe@debian.org>
+Subject: fix for pytest 6.x comptability
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979285
+
+--- docopt.orig/conftest.py
++++ docopt/conftest.py
+@@ -11,6 +11,8 @@
+ 
+ def pytest_collect_file(path, parent):
+     if path.ext == ".docopt" and path.basename.startswith("test"):
++        if hasattr(DocoptTestFile, "from_parent"):
++            return DocoptTestFile.from_parent(parent, fspath=path)
+         return DocoptTestFile(path, parent)
+ 
+ 
+@@ -41,7 +43,10 @@
+         for name, doc, cases in parse_test(raw):
+             name = self.fspath.purebasename
+             for case in cases:
+-                yield DocoptTestItem("%s(%d)" % (name, index), self, doc, 
case)
++                if hasattr(DocoptTestItem, "from_parent"):
++                    yield DocoptTestItem.from_parent(self, name="%s(%d)" % 
(name, index), doc=doc, case=case)
++                else:
++                    yield DocoptTestItem("%s(%d)" % (name, index), self, doc, 
case)
+                 index += 1
+ 
+ 
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index cb8568f..0890792 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -11563,7 +11563,8 @@ automatically detect a wide range of file encodings.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0aad9gbswnnhssin2q0m5lmpm0ahyf80ahs2zjigbn5y7fvljnd0"))))
+         "0aad9gbswnnhssin2q0m5lmpm0ahyf80ahs2zjigbn5y7fvljnd0"))
+       (patches (search-patches "python-docopt-pytest6-compat.patch"))))
     (build-system python-build-system)
     (native-inputs
      `(("python-pytest" ,python-pytest)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]