MCPcopy
hub / github.com/pydantic/pydantic / test_incompatible_metadata_error

Function test_incompatible_metadata_error

tests/test_annotated.py:610–613  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

608
609
610def test_incompatible_metadata_error() -> None:
611 ta = TypeAdapter(Annotated[list[int], Field(pattern='abc')])
612 with pytest.raises(TypeError, match="Unable to apply constraint 'pattern'"):
613 ta.validate_python([1, 2, 3])
614
615
616def test_compatible_metadata_raises_correct_validation_error() -> None:

Callers

nothing calls this directly

Calls 3

validate_pythonMethod · 0.95
TypeAdapterClass · 0.90
FieldFunction · 0.90

Tested by

no test coverage detected