public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/sybil/, dev-python/sybil/files/
Date: Mon, 29 Jan 2024 14:53:35 +0000 (UTC)	[thread overview]
Message-ID: <1706540010.641ddb19001069f92660b78b8877805fe23680d7.mgorny@gentoo> (raw)

commit:     641ddb19001069f92660b78b8877805fe23680d7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 29 14:43:52 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jan 29 14:53:30 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=641ddb19

dev-python/sybil: Add a fix for pytest-8

Closes: https://bugs.gentoo.org/923237
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/sybil/files/sybil-6.0.2-pytest-8.patch  | 40 ++++++++++++++++++++++
 .../{sybil-6.0.2.ebuild => sybil-6.0.2-r1.ebuild}  | 12 ++++++-
 2 files changed, 51 insertions(+), 1 deletion(-)

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
similarity index 77%
rename from dev-python/sybil/sybil-6.0.2.ebuild
rename to 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
+}


             reply	other threads:[~2024-01-29 14:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 14:53 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-02  9:57 [gentoo-commits] repo/gentoo:master commit in: dev-python/sybil/, dev-python/sybil/files/ Michał Górny
2021-08-19  6:34 Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1706540010.641ddb19001069f92660b78b8877805fe23680d7.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox