Skip to content

Commit 9110963

Browse files
committed
message typo
1 parent 01041e4 commit 9110963

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/errors/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ impl ErrorType {
490490
Self::IntType => "Input should be a valid integer",
491491
Self::IntParsing => "Input should be a valid integer, unable to parse string as an integer",
492492
Self::IntFromFloat => "Input should be a valid integer, got a number with a fractional part",
493-
Self::IntParsingSize => "Unable to parse input string as an integer, exceed maximum size",
493+
Self::IntParsingSize => "Unable to parse input string as an integer, exceeded maximum size",
494494
Self::FloatType => "Input should be a valid number",
495495
Self::FloatParsing => "Input should be a valid number, unable to parse string as an number",
496496
Self::BytesType => "Input should be a valid bytes",

tests/test_errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def f(input_value, info):
224224
('bool_parsing', 'Input should be a valid boolean, unable to interpret input', None),
225225
('int_type', 'Input should be a valid integer', None),
226226
('int_parsing', 'Input should be a valid integer, unable to parse string as an integer', None),
227-
('int_parsing_size', 'Unable to parse input string as an integer, exceed maximum size', None),
227+
('int_parsing_size', 'Unable to parse input string as an integer, exceeded maximum size', None),
228228
('int_from_float', 'Input should be a valid integer, got a number with a fractional part', None),
229229
('multiple_of', 'Input should be a multiple of 42.1', {'multiple_of': 42.1}),
230230
('greater_than', 'Input should be greater than 42.1', {'gt': 42.1}),

tests/validators/test_int.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def test_negative_int(input_value, expected):
165165
(
166166
int(1e30),
167167
Err(
168-
'Unable to parse input string as an integer, exceed maximum size '
168+
'Unable to parse input string as an integer, exceeded maximum size '
169169
'[type=int_parsing_size, input_value=1e+30, input_type=float]'
170170
),
171171
),
@@ -197,7 +197,10 @@ def test_positive_json(input_value, expected):
197197
(0, Err('Input should be less than 0 [type=less_than, input_value=0, input_type=int]')),
198198
(-i64_max, -i64_max),
199199
(-i64_max - 1, -i64_max - 1),
200-
(-i64_max * 2, Err(' Unable to parse input string as an integer, exceed maximum size [type=int_parsing_size')),
200+
(
201+
-i64_max * 2,
202+
Err(' Unable to parse input string as an integer, exceeded maximum size [type=int_parsing_size'),
203+
),
201204
],
202205
)
203206
def test_negative_json(input_value, expected):
@@ -347,14 +350,14 @@ def test_too_long():
347350
{
348351
'type': 'int_parsing_size',
349352
'loc': (),
350-
'msg': 'Unable to parse input string as an integer, exceed maximum size',
353+
'msg': 'Unable to parse input string as an integer, exceeded maximum size',
351354
'input': '1' * 4301,
352355
}
353356
]
354357
# insert_assert(repr(exc_info.value))
355358
assert repr(exc_info.value) == (
356359
"1 validation error for int\n"
357-
" Unable to parse input string as an integer, exceed maximum size "
360+
" Unable to parse input string as an integer, exceeded maximum size "
358361
"[type=int_parsing_size, input_value='111111111111111111111111...11111111111111111111111', input_type=str]\n"
359362
f" For further information visit https://errors.pydantic.dev/{__version__}/v/int_parsing_size"
360363
)

0 commit comments

Comments
 (0)