Skip to content

Commit 789614e

Browse files
committed
test case for overflow in parse_iso_8601_datetime
1 parent 4d1916c commit 789614e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/tests/tslibs/test_parse_iso8601.py

+12
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,15 @@ def test_parsers_iso8601_invalid_offset_invalid():
6060

6161
with pytest.raises(ValueError, match=msg):
6262
tslib._test_parse_iso8601(date_str)
63+
64+
65+
def test_parsers_iso8601_overflow():
66+
# if use char sublen variable in parse_iso_8601_datetime, then overflow
67+
# occurs and no exception is thrown
68+
date_str = "2013-01-01 05:30:00aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\
69+
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\
70+
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\
71+
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\
72+
"aaaaaaaaaaaaaaaaaaaaaa"
73+
with pytest.raises(ValueError):
74+
tslib._test_parse_iso8601(date_str)

0 commit comments

Comments
 (0)