MCPcopy
hub / github.com/pydantic/pydantic / test_generic_model_signature

Function test_generic_model_signature

tests/test_model_signature.py:37–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35
36
37def test_generic_model_signature():
38 T = TypeVar('T')
39
40 class Model(BaseModel, Generic[T]):
41 a: T
42
43 sig = signature(Model[int])
44 assert sig != signature(BaseModel)
45 assert _equals(map(str, sig.parameters.values()), ('a: int',))
46 assert _equals(str(sig), '(*, a: int) -> None')
47
48
49def test_custom_init_signature():

Callers

nothing calls this directly

Calls 2

valuesMethod · 0.80
_equalsFunction · 0.70

Tested by

no test coverage detected