MCPcopy
hub / github.com/pydantic/pydantic / test_wrap_validator_field_name

Function test_wrap_validator_field_name

tests/test_validators.py:2845–2852  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2843
2844
2845def test_wrap_validator_field_name():
2846 class MyModel(BaseModel):
2847 x: int
2848 foobar: Annotated[int, WrapValidator(validate_wrap)]
2849
2850 m = MyModel(x='123', foobar='1')
2851 # insert_assert(m.foobar)
2852 assert m.foobar == {'value': 1, 'field_name': 'foobar', 'data': {'x': 123}}
2853
2854
2855def test_validate_default_raises_for_basemodel() -> None:

Callers

nothing calls this directly

Calls 1

MyModelClass · 0.70

Tested by

no test coverage detected