Skip to content

Commit

Permalink
Fix typo in default factory error msg (#6880)
Browse files Browse the repository at this point in the history
  • Loading branch information
hramezani committed Jul 26, 2023
1 parent e245682 commit b688244
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pydantic/_internal/_std_types_schema.py
Expand Up @@ -639,7 +639,7 @@ def type_var_default_factory() -> None:
# a somewhat subjective set of types that have reasonable default values
allowed_msg = ', '.join([t.__name__ for t in set(allowed_default_types.values())])
raise PydanticSchemaGenerationError(
f'Unable to infer a default factory for with keys of type {values_source_type}.'
f'Unable to infer a default factory for keys of type {values_source_type}.'
f' Only {allowed_msg} are supported, other types require an explicit default factory'
' ' + instructions
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_types.py
Expand Up @@ -4967,7 +4967,7 @@ def test_defaultdict_unknown_default_factory() -> None:
"""
with pytest.raises(
PydanticSchemaGenerationError,
match=r'Unable to infer a default factory for with keys of type typing.DefaultDict\[int, int\]',
match=r'Unable to infer a default factory for keys of type typing.DefaultDict\[int, int\]',
):

class Model(BaseModel):
Expand Down

0 comments on commit b688244

Please sign in to comment.