projects/guix·blob javascript-team · refs

29 lines · 1.1 KiB

1https://sources.debian.org/data/main/d/docopt/0.6.2-3/debian/patches/pytest6
2
3From: Michael R. Crusoe <[email protected]>
4Subject: fix for pytest 6.x comptability
5Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979285
6
7--- docopt.orig/conftest.py
8+++ docopt/conftest.py
9@@ -11,6 +11,8 @@
10
11 def pytest_collect_file(path, parent):
12 if path.ext == ".docopt" and path.basename.startswith("test"):
13+ if hasattr(DocoptTestFile, "from_parent"):
14+ return DocoptTestFile.from_parent(parent, fspath=path)
15 return DocoptTestFile(path, parent)
16
17
18@@ -41,7 +43,10 @@
19 for name, doc, cases in parse_test(raw):
20 name = self.fspath.purebasename
21 for case in cases:
22- yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case)
23+ if hasattr(DocoptTestItem, "from_parent"):
24+ yield DocoptTestItem.from_parent(self, name="%s(%d)" % (name, index), doc=doc, case=case)
25+ else:
26+ yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case)
27 index += 1
28
29