Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
andresliszt committed Mar 8, 2024
1 parent cf70995 commit ad435e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tests/test_main.py
Expand Up @@ -2378,13 +2378,13 @@ class StrictModel(BaseModel):


@pytest.mark.xfail(
reason='To make validating json with strict=True work with sequence types it must be handled in pydantic-core'
reason='strict=True in model_validate_json does not overwrite strict=False given in ConfigDict'
'See issue: https://github.com/pydantic/pydantic/issues/8930'
)
def test_model_validate_list_strict() -> None:
# FIXME: This change must be implemented in pydantic-core. When ConfigDict(strict=False)
# the validate_json method is not overwriting strict false coming from sequence like schema
# See: https://github.com/pydantic/pydantic/issues/8930
# FIXME: This change must be implemented in pydantic-core. The argument strict=True
# in model_validate_json method is not overwriting the one set with ConfigDict(strict=False)
# for sequence like types. See: https://github.com/pydantic/pydantic/issues/8930

class LaxModel(BaseModel):
x: List[str]
Expand Down
1 change: 0 additions & 1 deletion tests/test_validate_call.py
Expand Up @@ -504,7 +504,6 @@ def foo(a: int, b: List[str]):
assert foo(1, ['bar', 'foobar']) == '1, bar'
with pytest.raises(ValidationError) as exc_info:
foo('foo', ('bar', 'foobar'))
# # insert_assert(exc_info.value.errors(include_url=False))
assert exc_info.value.errors(include_url=False) == [
{'type': 'int_type', 'loc': (0,), 'msg': 'Input should be a valid integer', 'input': 'foo'},
{'type': 'list_type', 'loc': (1,), 'msg': 'Input should be a valid list', 'input': ('bar', 'foobar')},
Expand Down

0 comments on commit ad435e1

Please sign in to comment.