aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python-docopt-pytest6-compat.patch
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2021-08-09 10:00:38 +0300
committerEfraim Flashner <efraim@flashner.co.il>2021-08-09 10:00:38 +0300
commit23b9dadc1decd040713fb2a409a9d4384e225135 (patch)
tree4ce00b1d0848cd716d1b2b0839d19c2ef0dd0e18 /gnu/packages/patches/python-docopt-pytest6-compat.patch
parent2ea947fb7db2208c04f8a929ebd95fad851b1d1d (diff)
downloadguix-23b9dadc1decd040713fb2a409a9d4384e225135.tar.gz
guix-23b9dadc1decd040713fb2a409a9d4384e225135.zip
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.
Diffstat (limited to 'gnu/packages/patches/python-docopt-pytest6-compat.patch')
-rw-r--r--gnu/packages/patches/python-docopt-pytest6-compat.patch29
1 files changed, 29 insertions, 0 deletions
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 0000000000..acd4955778
--- /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
+
+