public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: tests/scripts/
Date: Mon, 02 Jun 2025 13:16:50 +0000 (UTC)	[thread overview]
Message-ID: <1748870185.46a37bb18a13f1ec68273d00524c73e5b91823a0.arthurzam@gentoo> (raw)

commit:     46a37bb18a13f1ec68273d00524c73e5b91823a0
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat May 31 14:21:10 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Mon Jun  2 13:16:25 2025 +0000
URL:        https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=46a37bb1

tests: Wrap partial() in staticmethod(), in attributes for py3.14

Wrap `partial()` uses in class attributes in `staticmethod()`,
as required for them to work correctly in Python 3.14.

> functools.partial is now a method descriptor. Wrap it in staticmethod()
> if you want to preserve the old behavior.

(https://docs.python.org/3.14/whatsnew/3.14.html#changes-in-the-python-api)

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Part-of: https://github.com/pkgcore/pkgcheck/pull/738
Closes: https://github.com/pkgcore/pkgcheck/pull/738
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 tests/scripts/test_pkgcheck.py       | 4 ++--
 tests/scripts/test_pkgcheck_cache.py | 2 +-
 tests/scripts/test_pkgcheck_ci.py    | 2 +-
 tests/scripts/test_pkgcheck_show.py  | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/scripts/test_pkgcheck.py b/tests/scripts/test_pkgcheck.py
index 21b52424..a5ac7743 100644
--- a/tests/scripts/test_pkgcheck.py
+++ b/tests/scripts/test_pkgcheck.py
@@ -9,7 +9,7 @@ from pkgcheck.scripts import run
 
 def test_script_run(capsys):
     """Test regular code path for running scripts."""
-    script = partial(run, project)
+    script = staticmethod(partial(run, project))
 
     with patch(f"{project}.scripts.import_module") as import_module:
         import_module.side_effect = ImportError("baz module doesn't exist")
@@ -40,7 +40,7 @@ def test_script_run(capsys):
 
 
 class TestPkgcheck:
-    script = partial(run, project)
+    script = staticmethod(partial(run, project))
 
     def test_version(self, capsys):
         with patch("sys.argv", [project, "--version"]):

diff --git a/tests/scripts/test_pkgcheck_cache.py b/tests/scripts/test_pkgcheck_cache.py
index 09c75028..9e0b7e43 100644
--- a/tests/scripts/test_pkgcheck_cache.py
+++ b/tests/scripts/test_pkgcheck_cache.py
@@ -8,7 +8,7 @@ from pkgcheck.scripts import run
 
 
 class TestPkgcheckCache:
-    script = partial(run, project)
+    script = staticmethod(partial(run, project))
 
     @pytest.fixture(autouse=True)
     def _setup(self, testconfig, tmp_path):

diff --git a/tests/scripts/test_pkgcheck_ci.py b/tests/scripts/test_pkgcheck_ci.py
index 6530c0f0..9c32f31c 100644
--- a/tests/scripts/test_pkgcheck_ci.py
+++ b/tests/scripts/test_pkgcheck_ci.py
@@ -9,7 +9,7 @@ from pkgcore.ebuild.cpv import VersionedCPV
 
 
 class TestPkgcheckCi:
-    script = partial(run, "pkgcheck")
+    script = staticmethod(partial(run, "pkgcheck"))
 
     @pytest.fixture(autouse=True)
     def _setup(self, testconfig, tmp_path):

diff --git a/tests/scripts/test_pkgcheck_show.py b/tests/scripts/test_pkgcheck_show.py
index 26677059..cc48e67a 100644
--- a/tests/scripts/test_pkgcheck_show.py
+++ b/tests/scripts/test_pkgcheck_show.py
@@ -10,7 +10,7 @@ from pkgcheck.scripts import run
 
 
 class TestPkgcheckShow:
-    script = partial(run, project)
+    script = staticmethod(partial(run, project))
 
     @pytest.fixture(autouse=True)
     def _setup(self, testconfig):


             reply	other threads:[~2025-06-02 13:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-02 13:16 Arthur Zamarin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-09-22 18:43 [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: tests/scripts/ Arthur Zamarin
2022-11-19 17:20 Arthur Zamarin

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=1748870185.46a37bb18a13f1ec68273d00524c73e5b91823a0.arthurzam@gentoo \
    --to=arthurzam@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