MCPcopy
hub / github.com/pydantic/pydantic / test_annotated_validator

Function test_annotated_validator

tests/test_validate_call.py:844–849  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

842
843
844def test_annotated_validator():
845 @validate_call
846 def f(x: Annotated[int, BeforeValidator(lambda x: x + '2'), AfterValidator(lambda x: x + 1)]):
847 return x
848
849 assert f('1') == 13
850
851
852def test_annotated_strict():

Callers

nothing calls this directly

Calls 1

fFunction · 0.70

Tested by

no test coverage detected