MCPcopy
hub / github.com/pydantic/pydantic / MyModel

Class MyModel

tests/test_construction.py:81–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79
80def test_construct_with_aliases():
81 class MyModel(BaseModel):
82 x: int = Field(alias='x_alias')
83
84 my_model = MyModel.model_construct(x_alias=1)
85 assert my_model.x == 1

Callers

nothing calls this directly

Calls 3

FieldFunction · 0.90
AliasChoicesClass · 0.90
AliasPathClass · 0.90

Tested by

no test coverage detected