summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-01-29 15:43:52 +0100
committerMichał Górny <mgorny@gentoo.org>2024-01-29 15:53:30 +0100
commit641ddb19001069f92660b78b8877805fe23680d7 (patch)
tree31c31a8f9986baf4749543180f30b1c3c5115eae /dev-python/sybil
parentdev-qt/qtmultimedia: match [eglfs=] with qtbase in live (qt6) (diff)
downloadgentoo-641ddb19001069f92660b78b8877805fe23680d7.tar.gz
gentoo-641ddb19001069f92660b78b8877805fe23680d7.tar.bz2
gentoo-641ddb19001069f92660b78b8877805fe23680d7.zip
dev-python/sybil: Add a fix for pytest-8
Closes: https://bugs.gentoo.org/923237 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/sybil')
-rw-r--r--dev-python/sybil/files/sybil-6.0.2-pytest-8.patch40
-rw-r--r--dev-python/sybil/sybil-6.0.2-r1.ebuild (renamed from dev-python/sybil/sybil-6.0.2.ebuild)12
2 files changed, 51 insertions, 1 deletions
diff --git a/dev-python/sybil/files/sybil-6.0.2-pytest-8.patch b/dev-python/sybil/files/sybil-6.0.2-pytest-8.patch
new file mode 100644
index 000000000000..2447289c0266
--- /dev/null
+++ b/dev-python/sybil/files/sybil-6.0.2-pytest-8.patch
@@ -0,0 +1,40 @@
+From d7428b4cfe5f817037030d025028bf09fd7992ee Mon Sep 17 00:00:00 2001
+From: Adam Dangoor <adamdangoor@gmail.com>
+Date: Mon, 29 Jan 2024 11:29:16 +0000
+Subject: [PATCH] Add fixes for Pytest 8.0.0
+
+---
+ CHANGELOG.rst | 5 +++++
+ sybil/integration/pytest.py | 17 +++++++++++++----
+ 2 files changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/sybil/integration/pytest.py b/sybil/integration/pytest.py
+index 8ce6c72..cad311d 100644
+--- a/sybil/integration/pytest.py
++++ b/sybil/integration/pytest.py
+@@ -53,12 +53,21 @@ def __init__(self, parent, sybil, example: Example) -> None:
+ def request_fixtures(self, names):
+ # pytest fixtures dance:
+ fm = self.session._fixturemanager
+- closure = fm.getfixtureclosure(names, self)
+- initialnames, names_closure, arg2fixturedefs = closure
+- fixtureinfo = FuncFixtureInfo(names, initialnames, names_closure, arg2fixturedefs)
++ if PYTEST_VERSION >= (8, 0, 0):
++ closure = fm.getfixtureclosure(initialnames=names, parentnode=self, ignore_args=set())
++ names_closure, arg2fixturedefs = closure
++ fixtureinfo = FuncFixtureInfo(argnames=names, initialnames=names, names_closure=names_closure, name2fixturedefs=arg2fixturedefs)
++ else:
++ closure = fm.getfixtureclosure(names, self)
++ initialnames, names_closure, arg2fixturedefs = closure
++ fixtureinfo = FuncFixtureInfo(names, initialnames, names_closure, arg2fixturedefs)
+ self._fixtureinfo = fixtureinfo
+ self.funcargs = {}
+- self._request = fixtures.FixtureRequest(self, _ispytest=True)
++ if PYTEST_VERSION >= (8, 0, 0):
++ self._request = fixtures.TopRequest(pyfuncitem=self, _ispytest=True)
++ self.fixturenames = names_closure
++ else:
++ self._request = fixtures.FixtureRequest(self, _ispytest=True)
+
+ def reportinfo(self) -> Tuple[Union["os.PathLike[str]", str], Optional[int], str]:
+ info = '%s line=%i column=%i' % (
diff --git a/dev-python/sybil/sybil-6.0.2.ebuild b/dev-python/sybil/sybil-6.0.2-r1.ebuild
index 27065ab0f6bb..0a280c114202 100644
--- a/dev-python/sybil/sybil-6.0.2.ebuild
+++ b/dev-python/sybil/sybil-6.0.2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2019-2023 Gentoo Authors
+# Copyright 2019-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -32,3 +32,13 @@ BDEPEND="
"
distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/simplistix/sybil/pull/108
+ "${FILESDIR}/${P}-pytest-8.patch"
+)
+
+python_test() {
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ epytest
+}