From 2c2d27d69557f44de8a9e503704016e8b5c2c5ca Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Wed, 20 Jul 2022 09:31:23 -0700 Subject: [PATCH 1/5] TST/CI: xfail test_round_sanity for 32 bit --- pandas/tests/scalar/timedelta/test_timedelta.py | 14 +++++++++++++- pandas/tests/scalar/timestamp/test_unary_ops.py | 11 ++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/pandas/tests/scalar/timedelta/test_timedelta.py b/pandas/tests/scalar/timedelta/test_timedelta.py index b6559385e1597..025809e4600a3 100644 --- a/pandas/tests/scalar/timedelta/test_timedelta.py +++ b/pandas/tests/scalar/timedelta/test_timedelta.py @@ -14,6 +14,7 @@ iNaT, ) from pandas._libs.tslibs.dtypes import NpyDatetimeUnit +from pandas.compat import IS64 from pandas.errors import OutOfBoundsTimedelta import pandas as pd @@ -692,7 +693,18 @@ def test_round_implementation_bounds(self): @given(val=st.integers(min_value=iNaT + 1, max_value=lib.i8max)) @pytest.mark.parametrize( - "method", [Timedelta.round, Timedelta.floor, Timedelta.ceil] + "method", + [ + pytest.param( + Timedelta.round, + marks=pytest.mark.xfail(not IS64, reason="Failing on 32 bit build"), + ), + Timedelta.floor, + pytest.param( + Timedelta.ceil, + marks=pytest.mark.xfail(not IS64, reason="Failing on 32 bit build"), + ), + ], ) def test_round_sanity(self, val, method): val = np.int64(val) diff --git a/pandas/tests/scalar/timestamp/test_unary_ops.py b/pandas/tests/scalar/timestamp/test_unary_ops.py index 2146e32a437a9..dfdba405dd05c 100644 --- a/pandas/tests/scalar/timestamp/test_unary_ops.py +++ b/pandas/tests/scalar/timestamp/test_unary_ops.py @@ -21,6 +21,7 @@ ) from pandas._libs.tslibs.dtypes import NpyDatetimeUnit from pandas._libs.tslibs.period import INVALID_FREQ_ERR_MSG +from pandas.compat import IS64 import pandas.util._test_decorators as td import pandas._testing as tm @@ -299,7 +300,15 @@ def test_round_implementation_bounds(self): @given(val=st.integers(iNaT + 1, lib.i8max)) @pytest.mark.parametrize( - "method", [Timestamp.round, Timestamp.floor, Timestamp.ceil] + "method", + [ + Timestamp.round, + pytest.param( + Timedelta.floor, + marks=pytest.mark.xfail(not IS64, reason="Failing on 32 bit build"), + ), + Timestamp.ceil, + ], ) def test_round_sanity(self, val, method): val = np.int64(val) From da5ecd1fc09e86d0d642e6ab5b9d45d776617e40 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Wed, 20 Jul 2022 10:19:50 -0700 Subject: [PATCH 2/5] xfail generally --- pandas/tests/scalar/timedelta/test_timedelta.py | 11 +++-------- pandas/tests/scalar/timestamp/test_unary_ops.py | 6 ++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/pandas/tests/scalar/timedelta/test_timedelta.py b/pandas/tests/scalar/timedelta/test_timedelta.py index 025809e4600a3..2b2ea96a400bd 100644 --- a/pandas/tests/scalar/timedelta/test_timedelta.py +++ b/pandas/tests/scalar/timedelta/test_timedelta.py @@ -691,19 +691,14 @@ def test_round_implementation_bounds(self): with pytest.raises(OverflowError, match=msg): Timedelta.max.ceil("s") + @pytest.mark.xfail(not IS64, reason="Failing on 32 bit build") @given(val=st.integers(min_value=iNaT + 1, max_value=lib.i8max)) @pytest.mark.parametrize( "method", [ - pytest.param( - Timedelta.round, - marks=pytest.mark.xfail(not IS64, reason="Failing on 32 bit build"), - ), + Timedelta.round, Timedelta.floor, - pytest.param( - Timedelta.ceil, - marks=pytest.mark.xfail(not IS64, reason="Failing on 32 bit build"), - ), + Timedelta.ceil, ], ) def test_round_sanity(self, val, method): diff --git a/pandas/tests/scalar/timestamp/test_unary_ops.py b/pandas/tests/scalar/timestamp/test_unary_ops.py index dfdba405dd05c..ffe5f3756758e 100644 --- a/pandas/tests/scalar/timestamp/test_unary_ops.py +++ b/pandas/tests/scalar/timestamp/test_unary_ops.py @@ -298,15 +298,13 @@ def test_round_implementation_bounds(self): with pytest.raises(OverflowError, match=msg): Timestamp.max.ceil("s") + @pytest.mark.xfail(not IS64, reason="Failing on 32 bit build") @given(val=st.integers(iNaT + 1, lib.i8max)) @pytest.mark.parametrize( "method", [ Timestamp.round, - pytest.param( - Timedelta.floor, - marks=pytest.mark.xfail(not IS64, reason="Failing on 32 bit build"), - ), + Timedelta.floor, Timestamp.ceil, ], ) From c2a0310647b2d5bc5000db10a1732a59c663b2b9 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Wed, 20 Jul 2022 10:21:07 -0700 Subject: [PATCH 3/5] minimize diff --- pandas/tests/scalar/timedelta/test_timedelta.py | 6 +----- pandas/tests/scalar/timestamp/test_unary_ops.py | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/pandas/tests/scalar/timedelta/test_timedelta.py b/pandas/tests/scalar/timedelta/test_timedelta.py index 2b2ea96a400bd..bfdbb3f68e11f 100644 --- a/pandas/tests/scalar/timedelta/test_timedelta.py +++ b/pandas/tests/scalar/timedelta/test_timedelta.py @@ -695,11 +695,7 @@ def test_round_implementation_bounds(self): @given(val=st.integers(min_value=iNaT + 1, max_value=lib.i8max)) @pytest.mark.parametrize( "method", - [ - Timedelta.round, - Timedelta.floor, - Timedelta.ceil, - ], + [Timedelta.round, Timedelta.floor, Timedelta.ceil], ) def test_round_sanity(self, val, method): val = np.int64(val) diff --git a/pandas/tests/scalar/timestamp/test_unary_ops.py b/pandas/tests/scalar/timestamp/test_unary_ops.py index ffe5f3756758e..489e4affdefd4 100644 --- a/pandas/tests/scalar/timestamp/test_unary_ops.py +++ b/pandas/tests/scalar/timestamp/test_unary_ops.py @@ -302,11 +302,7 @@ def test_round_implementation_bounds(self): @given(val=st.integers(iNaT + 1, lib.i8max)) @pytest.mark.parametrize( "method", - [ - Timestamp.round, - Timedelta.floor, - Timestamp.ceil, - ], + [Timestamp.round, Timedelta.floor, Timestamp.ceil], ) def test_round_sanity(self, val, method): val = np.int64(val) From 8474523d0459a52912c737e660dd72ce68876373 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Wed, 20 Jul 2022 10:22:25 -0700 Subject: [PATCH 4/5] minimize again --- pandas/tests/scalar/timedelta/test_timedelta.py | 3 +-- pandas/tests/scalar/timestamp/test_unary_ops.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pandas/tests/scalar/timedelta/test_timedelta.py b/pandas/tests/scalar/timedelta/test_timedelta.py index bfdbb3f68e11f..bd4e9a5218d60 100644 --- a/pandas/tests/scalar/timedelta/test_timedelta.py +++ b/pandas/tests/scalar/timedelta/test_timedelta.py @@ -694,8 +694,7 @@ def test_round_implementation_bounds(self): @pytest.mark.xfail(not IS64, reason="Failing on 32 bit build") @given(val=st.integers(min_value=iNaT + 1, max_value=lib.i8max)) @pytest.mark.parametrize( - "method", - [Timedelta.round, Timedelta.floor, Timedelta.ceil], + "method", [Timedelta.round, Timedelta.floor, Timedelta.ceil] ) def test_round_sanity(self, val, method): val = np.int64(val) diff --git a/pandas/tests/scalar/timestamp/test_unary_ops.py b/pandas/tests/scalar/timestamp/test_unary_ops.py index 489e4affdefd4..89401a9472a56 100644 --- a/pandas/tests/scalar/timestamp/test_unary_ops.py +++ b/pandas/tests/scalar/timestamp/test_unary_ops.py @@ -301,8 +301,7 @@ def test_round_implementation_bounds(self): @pytest.mark.xfail(not IS64, reason="Failing on 32 bit build") @given(val=st.integers(iNaT + 1, lib.i8max)) @pytest.mark.parametrize( - "method", - [Timestamp.round, Timedelta.floor, Timestamp.ceil], + "method", [Timestamp.round, Timestamp.floor, Timestamp.ceil] ) def test_round_sanity(self, val, method): val = np.int64(val) From 52ea391f807d7a5c4cb408533c88aa7b682fc424 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Wed, 20 Jul 2022 13:39:02 -0700 Subject: [PATCH 5/5] strict=False --- pandas/tests/scalar/timedelta/test_timedelta.py | 2 +- pandas/tests/scalar/timestamp/test_unary_ops.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/scalar/timedelta/test_timedelta.py b/pandas/tests/scalar/timedelta/test_timedelta.py index bd4e9a5218d60..0dd3a88670ece 100644 --- a/pandas/tests/scalar/timedelta/test_timedelta.py +++ b/pandas/tests/scalar/timedelta/test_timedelta.py @@ -691,7 +691,7 @@ def test_round_implementation_bounds(self): with pytest.raises(OverflowError, match=msg): Timedelta.max.ceil("s") - @pytest.mark.xfail(not IS64, reason="Failing on 32 bit build") + @pytest.mark.xfail(not IS64, reason="Failing on 32 bit build", strict=False) @given(val=st.integers(min_value=iNaT + 1, max_value=lib.i8max)) @pytest.mark.parametrize( "method", [Timedelta.round, Timedelta.floor, Timedelta.ceil] diff --git a/pandas/tests/scalar/timestamp/test_unary_ops.py b/pandas/tests/scalar/timestamp/test_unary_ops.py index 89401a9472a56..cc11037660ad2 100644 --- a/pandas/tests/scalar/timestamp/test_unary_ops.py +++ b/pandas/tests/scalar/timestamp/test_unary_ops.py @@ -298,7 +298,7 @@ def test_round_implementation_bounds(self): with pytest.raises(OverflowError, match=msg): Timestamp.max.ceil("s") - @pytest.mark.xfail(not IS64, reason="Failing on 32 bit build") + @pytest.mark.xfail(not IS64, reason="Failing on 32 bit build", strict=False) @given(val=st.integers(iNaT + 1, lib.i8max)) @pytest.mark.parametrize( "method", [Timestamp.round, Timestamp.floor, Timestamp.ceil]