MCPcopy
hub / github.com/pydantic/pydantic / test_model_signature

Function test_model_signature

tests/test_model_signature.py:25–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24
25def test_model_signature():
26 class Model(BaseModel):
27 a: float = Field(title='A')
28 b: int = Field(10)
29 c: int = Field(default_factory=lambda: 1)
30
31 sig = signature(Model)
32 assert sig != signature(BaseModel)
33 assert _equals(map(str, sig.parameters.values()), ('a: float', 'b: int = 10', 'c: int = <factory>'))
34 assert _equals(str(sig), '(*, a: float, b: int = 10, c: int = <factory>) -> None')
35
36
37def test_generic_model_signature():

Callers

nothing calls this directly

Calls 2

valuesMethod · 0.80
_equalsFunction · 0.70

Tested by

no test coverage detected