| 1 | https://sources.debian.org/data/main/d/docopt/0.6.2-3/debian/patches/pytest6
|
| 2 |
|
| 3 | From: Michael R. Crusoe <[email protected]>
|
| 4 | Subject: fix for pytest 6.x comptability
|
| 5 | Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979285
|
| 6 |
|
| 7 | |
| 8 | |
| 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 |
|