MCPcopy
hub / github.com/pydantic/pydantic / test_allow_extra_repr

Function test_allow_extra_repr

tests/test_main.py:300–305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

298
299
300def test_allow_extra_repr():
301 class Model(BaseModel):
302 model_config = ConfigDict(extra='allow')
303 a: float = ...
304
305 assert str(Model(a='10.2', b=12)) == 'a=10.2 b=12'
306
307
308def test_forbidden_extra_success():

Callers

nothing calls this directly

Calls 1

ModelClass · 0.70

Tested by

no test coverage detected