()
| 87 | |
| 88 | |
| 89 | def test_annotated_validator_plain() -> None: |
| 90 | MyInt = Annotated[int, PlainValidator(lambda x, _info: x if x != -1 else 0)] |
| 91 | |
| 92 | class Model(BaseModel): |
| 93 | x: MyInt |
| 94 | |
| 95 | assert Model(x=0).x == 0 |
| 96 | assert Model(x=-1).x == 0 |
| 97 | assert Model(x=-2).x == -2 |
| 98 | |
| 99 | |
| 100 | def test_annotated_validator_wrap() -> None: |
nothing calls this directly
no test coverage detected