MCPcopy
hub / github.com/pydantic/pydantic / test_date_future

Function test_date_future

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

Source from the content-addressed store, hash-verified

280 ],
281)
282def test_date_future(py_and_json: PyAndJson, input_value, expected):
283 v = py_and_json(core_schema.date_schema(now_op='future'))
284 if isinstance(expected, Err):
285 with pytest.raises(ValidationError, match=re.escape(expected.message)):
286 v.validate_test(input_value)
287 assert v.isinstance_test(input_value) is False
288 else:
289 output = v.validate_test(input_value)
290 assert output == expected
291 assert v.isinstance_test(input_value) is True
292
293
294def test_date_past_future_today():

Callers

nothing calls this directly

Calls 4

py_and_jsonFunction · 0.85
date_schemaMethod · 0.80
validate_testMethod · 0.80
isinstance_testMethod · 0.80

Tested by

no test coverage detected