Skip to content

Commit dd6f610

Browse files
miggecjreback
authored andcommitted
TST: add test for #9107 (#28386)
1 parent b3bd4df commit dd6f610

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)