Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pandas/tests/tslibs/test_timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
offsets,
)

from pandas.errors import OutOfBoundsTimedelta


@pytest.mark.parametrize(
"obj,expected",
Expand Down Expand Up @@ -37,3 +39,9 @@ def test_huge_nanoseconds_overflow():
# GH 32402
assert delta_to_nanoseconds(Timedelta(1e10)) == 1e10
assert delta_to_nanoseconds(Timedelta(nanoseconds=1e10)) == 1e10


def test_out_of_bounds():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should go in pandas.tests.scalar.timedelta.test_constructors

# GH 36615
with pytest.raises(OutOfBoundsTimedelta, match="200000 days"):
Timedelta(np.timedelta64(200000, "D"))