MCPcopy
hub / github.com/pydantic/pydantic / test_repeated_ref

Function test_repeated_ref

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

Source from the content-addressed store, hash-verified

24
25
26def test_repeated_ref():
27 with pytest.raises(SchemaError, match='SchemaError: Duplicate ref: `foobar`'):
28 SchemaSerializer(
29 core_schema.tuple_positional_schema(
30 [
31 core_schema.definitions_schema(
32 core_schema.definition_reference_schema('foobar'), [core_schema.int_schema(ref='foobar')]
33 ),
34 core_schema.definitions_schema(
35 core_schema.definition_reference_schema('foobar'), [core_schema.int_schema(ref='foobar')]
36 ),
37 ]
38 )
39 )
40
41
42def test_repeat_after():

Callers

nothing calls this directly

Calls 3

definitions_schemaMethod · 0.80
int_schemaMethod · 0.80

Tested by

no test coverage detected