Skip to content

Commit 802ce4b

Browse files
Put regression test in separate test case
1 parent 10022ba commit 802ce4b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/tests/tslibs/test_timedeltas.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
(1, 1),
1717
(np.int64(2), 2),
1818
(np.int32(3), 3),
19-
(Timedelta(1e10), 1e10),
20-
(Timedelta(nanoseconds=1e10), 1e10),
2119
],
2220
)
2321
def test_delta_to_nanoseconds(obj, expected):
@@ -30,3 +28,8 @@ def test_delta_to_nanoseconds_error():
3028

3129
with pytest.raises(TypeError, match="<class 'numpy.ndarray'>"):
3230
delta_to_nanoseconds(obj)
31+
32+
33+
def test_huge_nanoseconds_overflow():
34+
assert delta_to_nanoseconds(Timedelta(1e10)) == 1e10
35+
assert delta_to_nanoseconds(Timedelta(nanoseconds=1e10)) == 1e10

0 commit comments

Comments
 (0)