MCPcopy
hub / github.com/pydantic/pydantic / test_parse_as_dataclass

Function test_parse_as_dataclass

tests/test_tools.py:65–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63
64
65def test_parse_as_dataclass():
66 @dataclass
67 class PydanticDataclass:
68 x: int
69
70 inputs = {'x': '1'}
71 assert parse_obj_as(PydanticDataclass, inputs) == PydanticDataclass(1)
72
73
74def test_parse_mapping_as():

Callers

nothing calls this directly

Calls 2

parse_obj_asFunction · 0.90
PydanticDataclassClass · 0.70

Tested by

no test coverage detected