MCPcopy
hub / github.com/pydantic/pydantic / test_parsing_model_naming

Function test_parsing_model_naming

tests/test_tools.py:54–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53
54def test_parsing_model_naming():
55 with pytest.raises(ValidationError) as exc_info:
56 parse_obj_as(int, 'a')
57 assert str(exc_info.value).split('\n')[0] == '1 validation error for int'
58
59 with pytest.raises(ValidationError) as exc_info:
60 with pytest.warns(PydanticDeprecatedSince20, match='The type_name parameter is deprecated'):
61 parse_obj_as(int, 'a', type_name='ParsingModel')
62 assert str(exc_info.value).split('\n')[0] == '1 validation error for int'
63
64
65def test_parse_as_dataclass():

Callers

nothing calls this directly

Calls 1

parse_obj_asFunction · 0.90

Tested by

no test coverage detected