(pydantic_version)
| 425 | |
| 426 | |
| 427 | def test_too_long(pydantic_version): |
| 428 | v = SchemaValidator(cs.int_schema()) |
| 429 | |
| 430 | with pytest.raises(ValidationError) as exc_info: |
| 431 | v.validate_python('1' * 4301) |
| 432 | |
| 433 | assert exc_info.value.errors(include_url=False) == [ |
| 434 | { |
| 435 | 'type': 'int_parsing_size', |
| 436 | 'loc': (), |
| 437 | 'msg': 'Unable to parse input string as an integer, exceeded maximum size', |
| 438 | 'input': '1' * 4301, |
| 439 | } |
| 440 | ] |
| 441 | # insert_assert(repr(exc_info.value)) |
| 442 | assert repr(exc_info.value) == ( |
| 443 | '1 validation error for int\n' |
| 444 | ' Unable to parse input string as an integer, exceeded maximum size ' |
| 445 | "[type=int_parsing_size, input_value='111111111111111111111111...11111111111111111111111', input_type=str]" |
| 446 | + ( |
| 447 | f'\n For further information visit https://errors.pydantic.dev/{pydantic_version}/v/int_parsing_size' |
| 448 | if os.environ.get('PYDANTIC_ERRORS_INCLUDE_URL', '1') != 'false' |
| 449 | else '' |
| 450 | ) |
| 451 | ) |
| 452 | |
| 453 | |
| 454 | def test_long_python(): |
nothing calls this directly
no test coverage detected