MCPcopy
hub / github.com/fastapi/fastapi / test_json_encoder_error_with_pydanticv1

Function test_json_encoder_error_with_pydanticv1

tests/test_jsonable_encoder.py:159–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157
158
159def test_json_encoder_error_with_pydanticv1():
160 with warnings.catch_warnings():
161 warnings.simplefilter("ignore", UserWarning)
162 from pydantic import v1
163
164 class ModelV1(v1.BaseModel):
165 name: str
166
167 data = ModelV1(name="test")
168 with pytest.raises(PydanticV1NotSupportedError):
169 jsonable_encoder(data)
170
171
172def test_encode_model_with_config():

Callers

nothing calls this directly

Calls 2

jsonable_encoderFunction · 0.90
ModelV1Class · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…