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 via email to