Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Oct 14, 2023
1 parent c869fe3 commit 05dd276
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions polyfactory/factories/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def get_constrained_field_value(cls, annotation: Any, field_meta: FieldMeta) ->
pattern=constraints.get("pattern"),
)

try:
with suppress(ValueError):
collection_type = get_collection_type(annotation)
if collection_type == dict:
return handle_constrained_mapping(
Expand All @@ -510,10 +510,6 @@ def get_constrained_field_value(cls, annotation: Any, field_meta: FieldMeta) ->
min_items=constraints.get("min_length"),
unique_items=constraints.get("unique_items", False),
)
except ValueError:
# implies the annotation was not a collection type
pass

if is_safe_subclass(annotation, date):
return handle_constrained_date(
faker=cls.__faker__,
Expand Down

0 comments on commit 05dd276

Please sign in to comment.