MCPcopy
hub / github.com/pydantic/pydantic / test_json_schema

Function test_json_schema

tests/test_deprecated.py:723–733  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

721
722
723def test_json_schema():
724 m = SimpleModel(x=1)
725 with pytest.warns(
726 PydanticDeprecatedSince20, match='^The `schema` method is deprecated; use `model_json_schema` instead.'
727 ):
728 assert m.schema() == {
729 'title': 'SimpleModel',
730 'type': 'object',
731 'properties': {'x': {'title': 'X', 'type': 'integer'}},
732 'required': ['x'],
733 }
734
735
736def test_validate():

Callers

nothing calls this directly

Calls 2

SimpleModelClass · 0.70
schemaMethod · 0.45

Tested by

no test coverage detected