Skip to content

Commit f35d23d

Browse files
committed
Support Python 3.14 partial() changes
functools.partial() was changed in Python 3.14 to be a method descriptor, which means we need to wrap it in staticmethod now. This change does appear to be backward compatible, so I haven't guarded it with a version check.
1 parent 604fe94 commit f35d23d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/test_fields.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ def test_unsupported_value_format(self):
693693

694694

695695
class FormatedStringFieldTest(StringTestMixin, BaseFieldTestMixin, FieldTestCase):
696-
field_class = partial(fields.FormattedString, "Hello {name}")
696+
field_class = staticmethod(partial(fields.FormattedString, "Hello {name}"))
697697

698698
def test_defaults(self):
699699
field = fields.FormattedString("Hello {name}")
@@ -731,7 +731,7 @@ def test_tuple(self):
731731

732732

733733
class UrlFieldTest(StringTestMixin, BaseFieldTestMixin, FieldTestCase):
734-
field_class = partial(fields.Url, "endpoint")
734+
field_class = staticmethod(partial(fields.Url, "endpoint"))
735735

736736
def test_defaults(self):
737737
field = fields.Url("endpoint")
@@ -931,7 +931,7 @@ def test_as_list_is_reusable(self, api):
931931

932932

933933
class ListFieldTest(BaseFieldTestMixin, FieldTestCase):
934-
field_class = partial(fields.List, fields.String)
934+
field_class = staticmethod(partial(fields.List, fields.String))
935935

936936
def test_defaults(self):
937937
field = fields.List(fields.String)
@@ -1025,7 +1025,7 @@ def test_list_of_raw(self):
10251025

10261026

10271027
class WildcardFieldTest(BaseFieldTestMixin, FieldTestCase):
1028-
field_class = partial(fields.Wildcard, fields.String)
1028+
field_class = staticmethod(partial(fields.Wildcard, fields.String))
10291029

10301030
def test_types(self):
10311031
with pytest.raises(fields.MarshallingError):

0 commit comments

Comments
 (0)