Skip to content

Commit 2091455

Browse files
miggecproost
authored andcommitted
TST: add test for pandas-dev#9107 (pandas-dev#28386)
1 parent 1fe8706 commit 2091455

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/indexes/datetimes/test_tools.py

+6
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,12 @@ def test_to_datetime_box_deprecated(self):
10351035
result = pd.to_datetime(expected).to_datetime64()
10361036
assert result == expected
10371037

1038+
@pytest.mark.parametrize("dt_str", ["00010101", "13000101", "30000101", "99990101"])
1039+
def test_to_datetime_with_format_out_of_bounds(self, dt_str):
1040+
# GH 9107
1041+
with pytest.raises(OutOfBoundsDatetime):
1042+
pd.to_datetime(dt_str, format="%Y%m%d")
1043+
10381044

10391045
class TestToDatetimeUnit:
10401046
@pytest.mark.parametrize("cache", [True, False])

0 commit comments

Comments
 (0)