Skip to content

Commit

Permalink
Reduce line size
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatal1ty committed Nov 14, 2023
1 parent ec9245e commit 2c441b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mashumaro/core/meta/types/unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ def _add_body(self, spec: ValueSpec, lines: CodeLines) -> None:
)
if spec.builder.is_nailed:
lines.append(
f"raise InvalidFieldValue('{spec.field_ctx.name}',{field_type},"
f"value,cls)"
f"raise InvalidFieldValue("
f"'{spec.field_ctx.name}',{field_type},value,cls)"
)
else:
lines.append("raise ValueError(value)")
Expand Down
6 changes: 4 additions & 2 deletions tests/test_discriminated_unions/test_union_by_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,11 @@ def test_by_supertypes_and_subtypes():
unannotated=UnannotatedVariantDateSubtype(DT_DATE),
class_var=ClassVarVariantDateSubtype(DT_DATE),
literal=LiteralVariantStr(DT_STR),
# using final without field discriminator can lead to unexpected result
# using final without field discriminator
# can lead to unexpected result
final=FinalVariantDateSubtype(DT_DATE, type=VariantType.STR),
# using enum without field discriminator can lead to unexpected result
# using enum without field discriminator
# can lead to unexpected result
enum=EnumVariantDateSubtype(DT_DATE, type=VariantType.STR),
)

Expand Down

0 comments on commit 2c441b1

Please sign in to comment.