MCPcopy
hub / github.com/pydantic/pydantic / init_schema_and_cleaned_schema

Function init_schema_and_cleaned_schema

tests/test_internal.py:27–33  ·  view source on GitHub ↗
(type_: Any)

Source from the content-addressed store, hash-verified

25
26
27def init_schema_and_cleaned_schema(type_: Any) -> tuple[CoreSchema, CoreSchema]:
28 gen = GenerateSchema(ConfigWrapper(None))
29 schema = gen.generate_schema(type_)
30 cleaned_schema = deepcopy(schema)
31 cleaned_schema = gen.clean_schema(cleaned_schema)
32 assert TypeAdapter(type_).pydantic_complete # Just to make sure it works and test setup is sane
33 return schema, cleaned_schema
34
35
36def test_simple_core_schema_with_no_references() -> None:

Calls 5

generate_schemaMethod · 0.95
clean_schemaMethod · 0.95
GenerateSchemaClass · 0.90
ConfigWrapperClass · 0.90
TypeAdapterClass · 0.90

Tested by

no test coverage detected