File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,18 @@ def test_str():
23
23
assert json .loads (json_emoji ) == 'emoji 💩'
24
24
25
25
26
+ def test_huge_str ():
27
+ v = SchemaSerializer (core_schema .int_schema ())
28
+ msg = "Expected `int` but got `str` with value `'123456789012345678901234...89012345678901234567890'` - serialized value may not be as expected"
29
+ with pytest .warns (UserWarning , match = msg ):
30
+ v .to_python (
31
+ '12345678901234567890123456789012345678901234567890123456789012345678901234567890\
32
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890\
33
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890\
34
+ 12345678901234567890123456789012345678901234567890123456789012345678901234567890'
35
+ )
36
+
37
+
26
38
def test_str_fallback ():
27
39
s = SchemaSerializer (core_schema .str_schema ())
28
40
assert s .to_python (None ) is None
You can’t perform that action at this time.
0 commit comments