Skip to content

Commit b57d287

Browse files
committed
Lower bounds for int32
1 parent 171b800 commit b57d287

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

pandas/tests/scalar/timedelta/test_timedelta.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
iNaT,
1515
)
1616
from pandas._libs.tslibs.dtypes import NpyDatetimeUnit
17+
from pandas.compat import IS64
1718
from pandas.errors import OutOfBoundsTimedelta
1819

1920
import pandas as pd
@@ -690,7 +691,12 @@ def test_round_implementation_bounds(self):
690691
with pytest.raises(OverflowError, match=msg):
691692
Timedelta.max.ceil("s")
692693

693-
@given(val=st.integers(min_value=iNaT + 1 + 10**9, max_value=lib.i8max - 10**9))
694+
@given(
695+
val=st.integers(
696+
min_value=iNaT + 1 + 10**9 if IS64 else np.iinfo(np.int32).min,
697+
max_value=lib.i8max - 10**9 if IS64 else np.iinfo(np.int32).max,
698+
)
699+
)
694700
@pytest.mark.parametrize(
695701
"method", [Timedelta.round, Timedelta.floor, Timedelta.ceil]
696702
)

pandas/tests/scalar/timestamp/test_unary_ops.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
)
2222
from pandas._libs.tslibs.dtypes import NpyDatetimeUnit
2323
from pandas._libs.tslibs.period import INVALID_FREQ_ERR_MSG
24+
from pandas.compat import IS64
2425
import pandas.util._test_decorators as td
2526

2627
import pandas._testing as tm
@@ -297,7 +298,12 @@ def test_round_implementation_bounds(self):
297298
with pytest.raises(OverflowError, match=msg):
298299
Timestamp.max.ceil("s")
299300

300-
@given(val=st.integers(iNaT + 1 + 10**9, lib.i8max - 10**9))
301+
@given(
302+
val=st.integers(
303+
iNaT + 1 + 10**9 if IS64 else np.iinfo(np.int32).min,
304+
lib.i8max - 10**9 if IS64 else np.iinfo(np.int32).max,
305+
)
306+
)
301307
@pytest.mark.parametrize(
302308
"method", [Timestamp.round, Timestamp.floor, Timestamp.ceil]
303309
)

0 commit comments

Comments
 (0)