MCPcopy
hub / github.com/pydantic/pydantic / test_use_after

Function test_use_after

pydantic-core/tests/serializers/test_definitions.py:85–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83
84
85def test_use_after():
86 v = SchemaSerializer(
87 core_schema.tuple_positional_schema(
88 [
89 core_schema.definitions_schema(
90 core_schema.definition_reference_schema('foobar'),
91 [
92 core_schema.int_schema(
93 ref='foobar', serialization=core_schema.to_string_ser_schema(when_used='always')
94 )
95 ],
96 ),
97 core_schema.definition_reference_schema('foobar'),
98 ]
99 )
100 )
101 assert v.to_python((1, 2)) == ('1', '2')
102
103
104def test_defs_with_dict():

Callers

nothing calls this directly

Calls 3

definitions_schemaMethod · 0.80
int_schemaMethod · 0.80

Tested by

no test coverage detected