Skip to content

Commit c37a2e6

Browse files
committed
Take kwargs in marshmallow post-processors
This is expected by upstream, and they have added arguments in newer releases. Fixes: #859
1 parent e4a3fa4 commit c37a2e6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/test_context_factory.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class UserSchema(Schema):
128128
name = fields.Str()
129129

130130
@post_dump()
131-
def check_context(self, data):
131+
def check_context(self, data, **kwargs):
132132
assert self.context["test"] == "context"
133133
self.context["test_number"] += 1
134134

@@ -304,7 +304,7 @@ class UserSchema(Schema):
304304
name = fields.Str()
305305

306306
@post_dump()
307-
def check_context(self, data):
307+
def check_context(self, data, **kwargs):
308308
assert self.context["test"] == "context"
309309
self.context["test_number"] += 1
310310

@@ -479,7 +479,7 @@ class UserSchema(Schema):
479479
name = fields.Str()
480480

481481
@post_dump()
482-
def check_context(self, data):
482+
def check_context(self, data, **kwargs):
483483
assert self.context["test"] == "context"
484484
self.context["test_number"] += 1
485485

tests/test_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ class MarshmallowContextSchema(Schema):
464464
name = fields.String()
465465

466466
@validates_schema
467-
def check_context(self, data):
467+
def check_context(self, data, **kwargs):
468468
assert self.context == custom_context
469469
self.context["marshmallow"] += 1
470470

0 commit comments

Comments
 (0)