From f7524cbc488e9c061081dc01fed8280064262b5f Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Sun, 21 Sep 2025 14:08:24 -0700 Subject: [PATCH] TST: Mark more tests as pytest.mark.slow --- pandas/tests/frame/indexing/test_where.py | 1 + pandas/tests/frame/test_constructors.py | 2 -- pandas/tests/groupby/test_cumulative.py | 1 - pandas/tests/indexes/ranges/test_setops.py | 1 + pandas/tests/io/parser/common/test_float.py | 3 +-- pandas/tests/io/sas/test_byteswap.py | 2 ++ pandas/tests/scalar/timedelta/methods/test_round.py | 3 +-- pandas/tests/scalar/timedelta/test_arithmetic.py | 1 - pandas/tests/scalar/timedelta/test_timedelta.py | 2 +- pandas/tests/scalar/timestamp/methods/test_round.py | 1 + pandas/tests/scalar/timestamp/methods/test_tz_localize.py | 1 - pandas/tests/scalar/timestamp/test_constructors.py | 1 - pandas/tests/scalar/timestamp/test_timestamp.py | 1 + pandas/tests/tools/test_to_datetime.py | 1 - pandas/tests/tseries/offsets/test_offsets_properties.py | 2 ++ pandas/tests/tseries/offsets/test_ticks.py | 2 ++ pandas/tests/tslibs/test_ccalendar.py | 1 + pandas/tests/tslibs/test_parsing.py | 1 + pyproject.toml | 1 - 19 files changed, 15 insertions(+), 13 deletions(-) diff --git a/pandas/tests/frame/indexing/test_where.py b/pandas/tests/frame/indexing/test_where.py index cb95014d92809..01dcce34e9fd2 100644 --- a/pandas/tests/frame/indexing/test_where.py +++ b/pandas/tests/frame/indexing/test_where.py @@ -950,6 +950,7 @@ def test_where_nullable_invalid_na(frame_or_series, any_numeric_ea_dtype): obj.mask(mask, null) +@pytest.mark.slow @given(data=OPTIONAL_ONE_OF_ALL) def test_where_inplace_casting(data): # GH 22051 diff --git a/pandas/tests/frame/test_constructors.py b/pandas/tests/frame/test_constructors.py index 2426c89dbcff5..264011edb65b5 100644 --- a/pandas/tests/frame/test_constructors.py +++ b/pandas/tests/frame/test_constructors.py @@ -3247,7 +3247,6 @@ def test_from_out_of_bounds_ns_datetime( assert item.asm8.dtype == exp_dtype assert dtype == exp_dtype - @pytest.mark.skip_ubsan def test_out_of_s_bounds_datetime64(self, constructor): scalar = np.datetime64(np.iinfo(np.int64).max, "D") result = constructor(scalar) @@ -3283,7 +3282,6 @@ def test_from_out_of_bounds_ns_timedelta( assert item.asm8.dtype == exp_dtype assert dtype == exp_dtype - @pytest.mark.skip_ubsan @pytest.mark.parametrize("cls", [np.datetime64, np.timedelta64]) def test_out_of_s_bounds_timedelta64(self, constructor, cls): scalar = cls(np.iinfo(np.int64).max, "D") diff --git a/pandas/tests/groupby/test_cumulative.py b/pandas/tests/groupby/test_cumulative.py index a1ace9e6a4c0f..cca4971e930b4 100644 --- a/pandas/tests/groupby/test_cumulative.py +++ b/pandas/tests/groupby/test_cumulative.py @@ -60,7 +60,6 @@ def test_groupby_cumprod(): tm.assert_series_equal(actual, expected) -@pytest.mark.skip_ubsan def test_groupby_cumprod_overflow(): # GH#37493 if we overflow we return garbage consistent with numpy df = DataFrame({"key": ["b"] * 4, "value": 100_000}) diff --git a/pandas/tests/indexes/ranges/test_setops.py b/pandas/tests/indexes/ranges/test_setops.py index ac24ff828cb8f..8a38ca7baf9b9 100644 --- a/pandas/tests/indexes/ranges/test_setops.py +++ b/pandas/tests/indexes/ranges/test_setops.py @@ -459,6 +459,7 @@ def assert_range_or_not_is_rangelike(index): assert not (diff == diff[0]).all() +@pytest.mark.slow @given( st.integers(-20, 20), st.integers(-20, 20), diff --git a/pandas/tests/io/parser/common/test_float.py b/pandas/tests/io/parser/common/test_float.py index 4e0b61577f9e7..598f397da686d 100644 --- a/pandas/tests/io/parser/common/test_float.py +++ b/pandas/tests/io/parser/common/test_float.py @@ -46,7 +46,7 @@ def test_scientific_no_exponent(all_parsers_all_precisions): [ -617, -100000, - pytest.param(-99999999999999999, marks=pytest.mark.skip_ubsan), + -99999999999999999, ], ) def test_very_negative_exponent(all_parsers_all_precisions, neg_exp): @@ -59,7 +59,6 @@ def test_very_negative_exponent(all_parsers_all_precisions, neg_exp): tm.assert_frame_equal(result, expected) -@pytest.mark.skip_ubsan @xfail_pyarrow # AssertionError: Attributes of DataFrame.iloc[:, 0] are different @pytest.mark.parametrize("exp", [999999999999999999, -999999999999999999]) def test_too_many_exponent_digits(all_parsers_all_precisions, exp, request): diff --git a/pandas/tests/io/sas/test_byteswap.py b/pandas/tests/io/sas/test_byteswap.py index 6d7f2f05d1b00..78f0d2232c4ba 100644 --- a/pandas/tests/io/sas/test_byteswap.py +++ b/pandas/tests/io/sas/test_byteswap.py @@ -18,6 +18,7 @@ import pandas._testing as tm +@pytest.mark.slow @given(read_offset=st.integers(0, 11), number=st.integers(min_value=0)) @example(number=2**16, read_offset=0) @example(number=2**32, read_offset=0) @@ -29,6 +30,7 @@ def test_int_byteswap(read_offset, number, int_type, should_byteswap): _test(number, int_type, read_offset, should_byteswap) +@pytest.mark.slow @pytest.mark.filterwarnings("ignore:overflow encountered:RuntimeWarning") @given(read_offset=st.integers(0, 11), number=st.floats()) @pytest.mark.parametrize("float_type", [np.float32, np.float64]) diff --git a/pandas/tests/scalar/timedelta/methods/test_round.py b/pandas/tests/scalar/timedelta/methods/test_round.py index 96cb1c07d2b76..bc50dc9e94bac 100644 --- a/pandas/tests/scalar/timedelta/methods/test_round.py +++ b/pandas/tests/scalar/timedelta/methods/test_round.py @@ -63,7 +63,6 @@ def test_round_invalid(self): with pytest.raises(ValueError, match=msg): t1.round(freq) - @pytest.mark.skip_ubsan def test_round_implementation_bounds(self): # See also: analogous test for Timestamp # GH#38964 @@ -89,7 +88,7 @@ def test_round_implementation_bounds(self): with pytest.raises(OutOfBoundsTimedelta, match=msg): Timedelta.max.round("s") - @pytest.mark.skip_ubsan + @pytest.mark.slow @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/timedelta/test_arithmetic.py b/pandas/tests/scalar/timedelta/test_arithmetic.py index 2183a5851ea9c..9347784fa1ec3 100644 --- a/pandas/tests/scalar/timedelta/test_arithmetic.py +++ b/pandas/tests/scalar/timedelta/test_arithmetic.py @@ -969,7 +969,6 @@ def test_td_op_timedelta_timedeltalike_array(self, op, arr): class TestTimedeltaComparison: - @pytest.mark.skip_ubsan def test_compare_pytimedelta_bounds(self): # GH#49021 don't overflow on comparison with very large pytimedeltas diff --git a/pandas/tests/scalar/timedelta/test_timedelta.py b/pandas/tests/scalar/timedelta/test_timedelta.py index a2fbec77df596..da22e49b24e54 100644 --- a/pandas/tests/scalar/timedelta/test_timedelta.py +++ b/pandas/tests/scalar/timedelta/test_timedelta.py @@ -587,7 +587,7 @@ def test_timedelta_hash_equality(self): ns_td = Timedelta(1, "ns") assert hash(ns_td) != hash(ns_td.to_pytimedelta()) - @pytest.mark.skip_ubsan + @pytest.mark.slow @pytest.mark.xfail( reason="pd.Timedelta violates the Python hash invariant (GH#44504).", ) diff --git a/pandas/tests/scalar/timestamp/methods/test_round.py b/pandas/tests/scalar/timestamp/methods/test_round.py index 6b27e5e6c5554..3c001aab01472 100644 --- a/pandas/tests/scalar/timestamp/methods/test_round.py +++ b/pandas/tests/scalar/timestamp/methods/test_round.py @@ -288,6 +288,7 @@ def test_round_implementation_bounds(self): with pytest.raises(OutOfBoundsDatetime, match=msg): Timestamp.max.round("s") + @pytest.mark.slow @given(val=st.integers(iNaT + 1, lib.i8max)) @pytest.mark.parametrize( "method", [Timestamp.round, Timestamp.floor, Timestamp.ceil] diff --git a/pandas/tests/scalar/timestamp/methods/test_tz_localize.py b/pandas/tests/scalar/timestamp/methods/test_tz_localize.py index cb7ac5fa6f1da..cad67a8db7eb8 100644 --- a/pandas/tests/scalar/timestamp/methods/test_tz_localize.py +++ b/pandas/tests/scalar/timestamp/methods/test_tz_localize.py @@ -15,7 +15,6 @@ class TestTimestampTZLocalize: - @pytest.mark.skip_ubsan def test_tz_localize_pushes_out_of_bounds(self): # GH#12677 # tz_localize that pushes away from the boundary is OK diff --git a/pandas/tests/scalar/timestamp/test_constructors.py b/pandas/tests/scalar/timestamp/test_constructors.py index 6398579f7444e..912875f818eb6 100644 --- a/pandas/tests/scalar/timestamp/test_constructors.py +++ b/pandas/tests/scalar/timestamp/test_constructors.py @@ -843,7 +843,6 @@ def test_barely_out_of_bounds(self): with pytest.raises(OutOfBoundsDatetime, match=msg): Timestamp("2262-04-11 23:47:16.854775808") - @pytest.mark.skip_ubsan def test_bounds_with_different_units(self): out_of_bounds_dates = ("1677-09-21", "2262-04-12") diff --git a/pandas/tests/scalar/timestamp/test_timestamp.py b/pandas/tests/scalar/timestamp/test_timestamp.py index 345386025b209..8e153827ad086 100644 --- a/pandas/tests/scalar/timestamp/test_timestamp.py +++ b/pandas/tests/scalar/timestamp/test_timestamp.py @@ -240,6 +240,7 @@ def test_dow_historic(self, date_string, expected): dow = ts.weekday() assert dow == expected + @pytest.mark.slow @given( ts=st.datetimes(), sign=st.sampled_from(["-", ""]), diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py index cedd9dfe82e5a..eddfeb80967ef 100644 --- a/pandas/tests/tools/test_to_datetime.py +++ b/pandas/tests/tools/test_to_datetime.py @@ -1129,7 +1129,6 @@ def test_to_datetime_dt64s_out_of_ns_bounds(self, cache, dt, errors): assert ts.unit == "s" assert ts.asm8 == dt - @pytest.mark.skip_ubsan def test_to_datetime_dt64d_out_of_bounds(self, cache): dt64 = np.datetime64(np.iinfo(np.int64).max, "D") diff --git a/pandas/tests/tseries/offsets/test_offsets_properties.py b/pandas/tests/tseries/offsets/test_offsets_properties.py index 809d8f87b2c02..e0c8839d3176a 100644 --- a/pandas/tests/tseries/offsets/test_offsets_properties.py +++ b/pandas/tests/tseries/offsets/test_offsets_properties.py @@ -28,6 +28,7 @@ # Offset-specific behaviour tests +@pytest.mark.slow @pytest.mark.arm_slow @given(DATETIME_JAN_1_1900_OPTIONAL_TZ, YQM_OFFSET) def test_on_offset_implementations(dt, offset): @@ -57,6 +58,7 @@ def test_on_offset_implementations(dt, offset): assert offset.is_on_offset(dt) == (compare == dt) +@pytest.mark.slow @given(YQM_OFFSET) def test_shift_across_dst(offset): # GH#18319 check that 1) timezone is correctly normalized and diff --git a/pandas/tests/tseries/offsets/test_ticks.py b/pandas/tests/tseries/offsets/test_ticks.py index f1065690233af..fae4320072042 100644 --- a/pandas/tests/tseries/offsets/test_ticks.py +++ b/pandas/tests/tseries/offsets/test_ticks.py @@ -61,6 +61,7 @@ def test_delta_to_tick(): assert tick == Nano(5) +@pytest.mark.slow @pytest.mark.parametrize("cls", tick_classes) @example(n=2, m=3) @example(n=800, m=300) @@ -80,6 +81,7 @@ def test_tick_add_sub(cls, n, m): assert left - right == expected +@pytest.mark.slow @pytest.mark.arm_slow @pytest.mark.parametrize("cls", tick_classes) @example(n=2, m=3) diff --git a/pandas/tests/tslibs/test_ccalendar.py b/pandas/tests/tslibs/test_ccalendar.py index 8dd1bd47e4728..aeb9d3387c91a 100644 --- a/pandas/tests/tslibs/test_ccalendar.py +++ b/pandas/tests/tslibs/test_ccalendar.py @@ -56,6 +56,7 @@ def test_dt_correct_iso_8601_year_week_and_day(input_date_tuple, expected_iso_tu assert result == expected_iso_tuple +@pytest.mark.slow @given(DATETIME_IN_PD_TIMESTAMP_RANGE_NO_TZ) def test_isocalendar(dt): expected = dt.isocalendar() diff --git a/pandas/tests/tslibs/test_parsing.py b/pandas/tests/tslibs/test_parsing.py index 72515c030757b..6c134a11cb530 100644 --- a/pandas/tests/tslibs/test_parsing.py +++ b/pandas/tests/tslibs/test_parsing.py @@ -388,6 +388,7 @@ def _helper_hypothesis_delimited_date(call, date_string, **kwargs): return msg, result +@pytest.mark.slow @given(DATETIME_NO_TZ) @pytest.mark.parametrize("delimiter", list(" -./")) @pytest.mark.parametrize("dayfirst", [True, False]) diff --git a/pyproject.toml b/pyproject.toml index a00d6e71b14e3..973857bbd1d9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -485,7 +485,6 @@ markers = [ "db: tests requiring a database (mysql or postgres)", "clipboard: mark a pd.read_clipboard test", "arm_slow: mark a test as slow for arm64 architecture", - "skip_ubsan: Tests known to fail UBSAN check", # TODO: someone should investigate this ... # these tests only fail in the wheel builder and don't fail in regular # ARM CI