Skip to content

Commit 13c8e95

Browse files
committed
Added test for parsing leading spaces
1 parent 2bdddc8 commit 13c8e95

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

pandas/tests/tslibs/test_parse_iso8601.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,7 @@ def test_parsers_iso8601_invalid_offset_invalid():
6262
tslib._test_parse_iso8601(date_str)
6363

6464

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)
65+
def test_parsers_iso8601_leading_space():
66+
date_str, expected = ("2013-1-1 5:30:00", datetime(2013, 1, 1, 5, 30))
67+
actual = tslib._test_parse_iso8601(' ' * 200 + date_str)
68+
assert actual == expected

0 commit comments

Comments
 (0)