MCPcopy
hub / github.com/pydantic/pydantic / test_date_json

Function test_date_json

pydantic-core/tests/validators/test_date.py:130–139  ·  view source on GitHub ↗
(py_and_json: PyAndJson, input_value, expected)

Source from the content-addressed store, hash-verified

128 ],
129)
130def test_date_json(py_and_json: PyAndJson, input_value, expected):
131 v = py_and_json({'type': 'date'})
132 if isinstance(expected, Err):
133 with pytest.raises(ValidationError, match=re.escape(expected.message)):
134 v.validate_test(input_value)
135 assert v.isinstance_test(input_value) is False
136 else:
137 output = v.validate_test(input_value)
138 assert output == expected
139 assert v.isinstance_test(input_value) is True
140
141
142@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

py_and_jsonFunction · 0.85
validate_testMethod · 0.80
isinstance_testMethod · 0.80

Tested by

no test coverage detected