Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 13, 2023
1 parent 3d97786 commit 227736d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions strawberry/experimental/pydantic2/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def _convert_from_pydantic_to_strawberry_type(

return data

Check warning on line 64 in strawberry/experimental/pydantic2/conversion.py

View check run for this annotation

Codecov / codecov/patch

strawberry/experimental/pydantic2/conversion.py#L64

Added line #L64 was not covered by tests


def convert_pydantic_model_to_strawberry_class(
cls, *, model_instance=None, extra=None # noqa: ANN001
) -> Any:
Expand Down
8 changes: 6 additions & 2 deletions tests/experimental/pydantic/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,9 @@ class UserType:
password: strawberry.auto

@staticmethod
def from_pydantic(instance: User, extra: Optional[Dict[str, Any]] = None) -> "UserType":
def from_pydantic(
instance: User, extra: Optional[Dict[str, Any]] = None
) -> "UserType":
return UserType(
age=str(instance.age),
password=base64.b64encode(instance.password.encode()).decode()
Expand Down Expand Up @@ -1024,7 +1026,9 @@ class UserType:
password: strawberry.auto

@staticmethod
def from_pydantic(instance: User, extra: Optional[Dict[str, Any]] = None) -> "UserType":
def from_pydantic(
instance: User, extra: Optional[Dict[str, Any]] = None
) -> "UserType":
return UserType(
age=str(instance.age),
password=base64.b64encode(instance.password.encode()).decode()
Expand Down

0 comments on commit 227736d

Please sign in to comment.