MCPcopy
hub / github.com/pydantic/pydantic / test_int_overflow_validation

Function test_int_overflow_validation

tests/test_validators.py:251–259  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

249
250@pytest.mark.parametrize('value', [2.2250738585072011e308, float('nan'), float('inf')])
251def test_int_overflow_validation(value):
252 class Model(BaseModel):
253 a: int
254
255 with pytest.raises(ValidationError) as exc_info:
256 Model(a=value)
257 assert exc_info.value.errors(include_url=False) == [
258 {'type': 'finite_number', 'loc': ('a',), 'msg': 'Input should be a finite number', 'input': value}
259 ]
260
261
262def test_frozenset_validation():

Callers

nothing calls this directly

Calls 2

ModelClass · 0.70
errorsMethod · 0.45

Tested by

no test coverage detected