MCPcopy
hub / github.com/pydantic/pydantic / validate_test

Method validate_test

pydantic-core/tests/conftest.py:76–88  ·  view source on GitHub ↗
(
        self, py_input, strict: bool | None = None, context: Any = None, extra: ExtraBehavior | None = None
    )

Source from the content-addressed store, hash-verified

74 return self.validator.validate_json(json_str, strict=strict, context=context)
75
76 def validate_test(
77 self, py_input, strict: bool | None = None, context: Any = None, extra: ExtraBehavior | None = None
78 ):
79 if self.validator_type == 'json':
80 return self.validator.validate_json(
81 json.dumps(py_input, default=json_default),
82 strict=strict,
83 extra=extra,
84 context=context,
85 )
86 else:
87 assert self.validator_type == 'python', self.validator_type
88 return self.validator.validate_python(py_input, strict=strict, context=context, extra=extra)
89
90 def isinstance_test(self, py_input, strict: bool | None = None, context: Any = None):
91 if self.validator_type == 'json':

Callers 15

test_int_strict_argumentFunction · 0.80
test_omitFunction · 0.80
test_afterFunction · 0.80
test_mutable_contextFunction · 0.80
test_typed_dictFunction · 0.80
test_wrapFunction · 0.80
test_isinstanceFunction · 0.80
test_list_omit_exceptionFunction · 0.80
test_list_jsonFunction · 0.80
test_dict_valuesFunction · 0.80
test_custom_errorFunction · 0.80

Calls 2

validate_jsonMethod · 0.45
validate_pythonMethod · 0.45

Tested by

no test coverage detected