MCPcopy
hub / github.com/pydantic/pydantic / test_parse_obj_fails

Function test_parse_obj_fails

tests/test_tools.py:41–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40
41def test_parse_obj_fails():
42 with pytest.raises(ValidationError) as exc_info:
43 parse_obj_as(int, 'a')
44 assert exc_info.value.errors(include_url=False) == [
45 {
46 'input': 'a',
47 'loc': (),
48 'msg': 'Input should be a valid integer, unable to parse string as an integer',
49 'type': 'int_parsing',
50 }
51 ]
52
53
54def test_parsing_model_naming():

Callers

nothing calls this directly

Calls 2

parse_obj_asFunction · 0.90
errorsMethod · 0.45

Tested by

no test coverage detected