Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/serializers/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ impl PydanticSerializationUnexpectedValue {
if let Some(field_name) = &self.field_name {
write!(
message,
" [field_name={field_name}, input_value={value_str}, input_type={input_type}]"
" [field_name='{field_name}', input_value={value_str}, input_type={input_type}]"
)
.expect("writing to string should never fail");
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/serializers/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def test_model_wrong_warn():

with pytest.warns(
UserWarning,
match=r"Expected `int` - serialized value may not be as expected \[field_name=foo, input_value='lorem', input_type=str\]",
match=r"Expected `int` - serialized value may not be as expected \[field_name='foo', input_value='lorem', input_type=str\]",
):
assert s.to_python(BasicModel(foo='lorem')) == {'foo': 'lorem'}

Expand Down
Loading