MCPcopy
hub / github.com/pydantic/pydantic / test_config_title_cls

Function test_config_title_cls

tests/test_deprecated_validate_arguments.py:317–327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

315
316
317def test_config_title_cls():
318 class Config:
319 title = 'Testing'
320
321 @validate_arguments(config={'title': 'Testing'})
322 def foo(a: int, b: int):
323 return f'{a}, {b}'
324
325 assert foo(1, 2) == '1, 2'
326 assert foo(1, b=2) == '1, 2'
327 assert foo.model.model_json_schema()['title'] == 'Testing'
328
329
330def test_config_fields():

Callers

nothing calls this directly

Calls 2

fooFunction · 0.70
model_json_schemaMethod · 0.45

Tested by

no test coverage detected