commit: 7dc5a2b5dda1faa4de3c3f061999cd93fdd4ce09 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Sat May 31 14:07:29 2025 +0000 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> CommitDate: Sun Jun 1 06:59:10 2025 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=7dc5a2b5
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/pkgcore/pull/446 Closes: https://github.com/pkgcore/pkgcore/pull/446 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> tests/ebuild/test_profiles.py | 2 +- tests/restrictions/test_restriction.py | 2 +- tests/restrictions/test_values.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ebuild/test_profiles.py b/tests/ebuild/test_profiles.py index f1b54863..4e61d3e6 100644 --- a/tests/ebuild/test_profiles.py +++ b/tests/ebuild/test_profiles.py @@ -788,7 +788,7 @@ class TestPortage1ProfileNode(TestPmsProfileNode): ] ) - klass = partial(TestPmsProfileNode.klass, pms_strict=False) + klass = staticmethod(partial(TestPmsProfileNode.klass, pms_strict=False)) def write_file(self, tmp_path, filename, text, profile=None): if filename not in self.can_be_dirs: diff --git a/tests/restrictions/test_restriction.py b/tests/restrictions/test_restriction.py index 37a26be8..e19298a7 100644 --- a/tests/restrictions/test_restriction.py +++ b/tests/restrictions/test_restriction.py @@ -47,7 +47,7 @@ class TestBase(TestRestriction): class TestAlwaysBool(TestRestriction): - bool_kls = partial(restriction.AlwaysBool, "foo") + bool_kls = staticmethod(partial(restriction.AlwaysBool, "foo")) def test_true(self): true_r = self.bool_kls(True) diff --git a/tests/restrictions/test_values.py b/tests/restrictions/test_values.py index 40450c42..981258a7 100644 --- a/tests/restrictions/test_values.py +++ b/tests/restrictions/test_values.py @@ -306,7 +306,7 @@ class TestEqualityMatch(TestRestriction): class TestContainmentMatch(TestRestriction): - kls = partial(values.ContainmentMatch, disable_inst_caching=True) + kls = staticmethod(partial(values.ContainmentMatch, disable_inst_caching=True)) def test_match(self): for x, y, ret in (
