From 7fe067d058a03aabfc7d81fc2ac36910af7721ff Mon Sep 17 00:00:00 2001 From: phofl Date: Sat, 24 Apr 2021 17:30:41 +0200 Subject: [PATCH 1/2] Mark slow tests as slow to speed up ci --- pandas/tests/frame/test_constructors.py | 1 + pandas/tests/groupby/transform/test_transform.py | 2 +- pandas/tests/indexes/datetimes/test_date_range.py | 1 + pandas/tests/indexes/multi/test_integrity.py | 2 +- pandas/tests/indexing/interval/test_interval.py | 2 +- .../tests/indexing/multiindex/test_chaining_and_caching.py | 2 +- pandas/tests/io/parser/common/test_chunksize.py | 2 ++ pandas/tests/io/parser/test_c_parser_only.py | 2 ++ pandas/tests/io/sas/test_sas7bdat.py | 6 ++++++ pandas/tests/io/sas/test_xport.py | 1 + pandas/tests/test_sorting.py | 2 +- .../tests/window/moments/test_moments_rolling_skew_kurt.py | 1 + 12 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pandas/tests/frame/test_constructors.py b/pandas/tests/frame/test_constructors.py index c565567754da0..26a97416f3d3a 100644 --- a/pandas/tests/frame/test_constructors.py +++ b/pandas/tests/frame/test_constructors.py @@ -1011,6 +1011,7 @@ def test_constructor_maskedrecarray_dtype(self): alt = DataFrame({name: data[name] for name in data.dtype.names}, dtype=int) tm.assert_frame_equal(result, alt) + @pytest.mark.slow def test_constructor_mrecarray(self): # Ensure mrecarray produces frame identical to dict of masked arrays # from GH3479 diff --git a/pandas/tests/groupby/transform/test_transform.py b/pandas/tests/groupby/transform/test_transform.py index 9350a3fcd3036..14c117bf7257a 100644 --- a/pandas/tests/groupby/transform/test_transform.py +++ b/pandas/tests/groupby/transform/test_transform.py @@ -631,7 +631,7 @@ def test_groupby_cum_skipna(op, skipna, input, exp): tm.assert_series_equal(expected, result) -@pytest.mark.arm_slow +@pytest.mark.slow @pytest.mark.parametrize( "op, args, targop", [ diff --git a/pandas/tests/indexes/datetimes/test_date_range.py b/pandas/tests/indexes/datetimes/test_date_range.py index ed9a5054986cb..935e6afec246e 100644 --- a/pandas/tests/indexes/datetimes/test_date_range.py +++ b/pandas/tests/indexes/datetimes/test_date_range.py @@ -146,6 +146,7 @@ def test_date_range_int64_overflow_non_recoverable(self): with pytest.raises(OutOfBoundsDatetime, match=msg): date_range(end="1969-11-14", periods=106752 * 24, freq="H") + @pytest.mark.slow def test_date_range_int64_overflow_stride_endpoint_different_signs(self): # cases where stride * periods overflow int64 and stride/endpoint # have different signs diff --git a/pandas/tests/indexes/multi/test_integrity.py b/pandas/tests/indexes/multi/test_integrity.py index ff0c2a0d67885..0e812f2d4590c 100644 --- a/pandas/tests/indexes/multi/test_integrity.py +++ b/pandas/tests/indexes/multi/test_integrity.py @@ -122,7 +122,7 @@ def test_consistency(): assert index.is_unique is False -@pytest.mark.arm_slow +@pytest.mark.slow def test_hash_collisions(): # non-smoke test that we don't get hash collisions diff --git a/pandas/tests/indexing/interval/test_interval.py b/pandas/tests/indexing/interval/test_interval.py index eb13ec1f366af..395e9297a8fde 100644 --- a/pandas/tests/indexing/interval/test_interval.py +++ b/pandas/tests/indexing/interval/test_interval.py @@ -71,7 +71,7 @@ def test_getitem_non_matching(self, series_with_interval_index, indexer_sl): with pytest.raises(KeyError, match=r"^\[-1\]$"): indexer_sl(ser)[[-1, 3]] - @pytest.mark.arm_slow + @pytest.mark.slow def test_loc_getitem_large_series(self): ser = Series( np.arange(1000000), index=IntervalIndex.from_breaks(np.arange(1000001)) diff --git a/pandas/tests/indexing/multiindex/test_chaining_and_caching.py b/pandas/tests/indexing/multiindex/test_chaining_and_caching.py index 1db354a7f30b5..6ccd44e698a8a 100644 --- a/pandas/tests/indexing/multiindex/test_chaining_and_caching.py +++ b/pandas/tests/indexing/multiindex/test_chaining_and_caching.py @@ -56,7 +56,7 @@ def test_cache_updating(): assert result == 2 -@pytest.mark.arm_slow +@pytest.mark.slow def test_indexer_caching(): # GH5727 # make sure that indexers are in the _internal_names_set diff --git a/pandas/tests/io/parser/common/test_chunksize.py b/pandas/tests/io/parser/common/test_chunksize.py index 6d5aeaa713687..d75383607adda 100644 --- a/pandas/tests/io/parser/common/test_chunksize.py +++ b/pandas/tests/io/parser/common/test_chunksize.py @@ -162,6 +162,7 @@ def test_chunk_begins_with_newline_whitespace(all_parsers): tm.assert_frame_equal(result, expected) +@pytest.mark.slow @pytest.mark.xfail(reason="GH38630, sometimes gives ResourceWarning", strict=False) def test_chunks_have_consistent_numerical_type(all_parsers): parser = all_parsers @@ -176,6 +177,7 @@ def test_chunks_have_consistent_numerical_type(all_parsers): assert result.a.dtype == float +@pytest.mark.slow def test_warn_if_chunks_have_mismatched_type(all_parsers, request): warning_type = None parser = all_parsers diff --git a/pandas/tests/io/parser/test_c_parser_only.py b/pandas/tests/io/parser/test_c_parser_only.py index f8aff3ad3696a..044af57f49240 100644 --- a/pandas/tests/io/parser/test_c_parser_only.py +++ b/pandas/tests/io/parser/test_c_parser_only.py @@ -159,6 +159,7 @@ def test_unsupported_dtype(c_parser_only, match, kwargs): @td.skip_if_32bit +@pytest.mark.slow def test_precise_conversion(c_parser_only): from decimal import Decimal @@ -300,6 +301,7 @@ def test_tokenize_CR_with_quoting(c_parser_only): tm.assert_frame_equal(result, expected) +@pytest.mark.slow def test_grow_boundary_at_cap(c_parser_only): # See gh-12494 # diff --git a/pandas/tests/io/sas/test_sas7bdat.py b/pandas/tests/io/sas/test_sas7bdat.py index e20d78effa931..3b6bfee8f9657 100644 --- a/pandas/tests/io/sas/test_sas7bdat.py +++ b/pandas/tests/io/sas/test_sas7bdat.py @@ -39,6 +39,7 @@ def setup_method(self, datapath): df.iloc[:, k] = df.iloc[:, k].astype(np.float64) self.data.append(df) + @pytest.mark.slow def test_from_file(self): for j in 0, 1: df0 = self.data[j] @@ -47,6 +48,7 @@ def test_from_file(self): df = pd.read_sas(fname, encoding="utf-8") tm.assert_frame_equal(df, df0) + @pytest.mark.slow def test_from_buffer(self): for j in 0, 1: df0 = self.data[j] @@ -61,6 +63,7 @@ def test_from_buffer(self): df = rdr.read() tm.assert_frame_equal(df, df0, check_exact=False) + @pytest.mark.slow def test_from_iterator(self): for j in 0, 1: df0 = self.data[j] @@ -72,6 +75,7 @@ def test_from_iterator(self): df = rdr.read(3) tm.assert_frame_equal(df, df0.iloc[2:5, :]) + @pytest.mark.slow def test_path_pathlib(self): for j in 0, 1: df0 = self.data[j] @@ -81,6 +85,7 @@ def test_path_pathlib(self): tm.assert_frame_equal(df, df0) @td.skip_if_no("py.path") + @pytest.mark.slow def test_path_localpath(self): from py.path import local as LocalPath @@ -91,6 +96,7 @@ def test_path_localpath(self): df = pd.read_sas(fname, encoding="utf-8") tm.assert_frame_equal(df, df0) + @pytest.mark.slow def test_iterator_loop(self): # github #13654 for j in 0, 1: diff --git a/pandas/tests/io/sas/test_xport.py b/pandas/tests/io/sas/test_xport.py index a8713f5bf36c9..5d3e3b8e23cdb 100644 --- a/pandas/tests/io/sas/test_xport.py +++ b/pandas/tests/io/sas/test_xport.py @@ -34,6 +34,7 @@ def setup_method(self, datapath): with td.file_leak_context(): yield + @pytest.mark.slow def test1_basic(self): # Tests with DEMO_G.xpt (all numeric file) diff --git a/pandas/tests/test_sorting.py b/pandas/tests/test_sorting.py index 2fa3acf939c5b..6799295660870 100644 --- a/pandas/tests/test_sorting.py +++ b/pandas/tests/test_sorting.py @@ -67,7 +67,7 @@ def test_int64_overflow(self): assert left[k] == v assert len(left) == len(right) - @pytest.mark.arm_slow + @pytest.mark.slow def test_int64_overflow_moar(self): # GH9096 diff --git a/pandas/tests/window/moments/test_moments_rolling_skew_kurt.py b/pandas/tests/window/moments/test_moments_rolling_skew_kurt.py index 3cd4b115c90c7..34d5f686eb853 100644 --- a/pandas/tests/window/moments/test_moments_rolling_skew_kurt.py +++ b/pandas/tests/window/moments/test_moments_rolling_skew_kurt.py @@ -152,6 +152,7 @@ def test_center_reindex_series(series, roll_func): tm.assert_series_equal(series_xp, series_rs) +@pytest.mark.slow @pytest.mark.parametrize("roll_func", ["kurt", "skew"]) def test_center_reindex_frame(frame, roll_func): # shifter index From a8f79475140e8b2d9b0cddb2bb2a06c81028492d Mon Sep 17 00:00:00 2001 From: phofl Date: Sat, 24 Apr 2021 22:35:17 +0200 Subject: [PATCH 2/2] Move two tests back in --- pandas/tests/io/parser/common/test_chunksize.py | 1 - pandas/tests/test_sorting.py | 1 - 2 files changed, 2 deletions(-) diff --git a/pandas/tests/io/parser/common/test_chunksize.py b/pandas/tests/io/parser/common/test_chunksize.py index d75383607adda..ceb770ce72b78 100644 --- a/pandas/tests/io/parser/common/test_chunksize.py +++ b/pandas/tests/io/parser/common/test_chunksize.py @@ -177,7 +177,6 @@ def test_chunks_have_consistent_numerical_type(all_parsers): assert result.a.dtype == float -@pytest.mark.slow def test_warn_if_chunks_have_mismatched_type(all_parsers, request): warning_type = None parser = all_parsers diff --git a/pandas/tests/test_sorting.py b/pandas/tests/test_sorting.py index 6799295660870..a49b7c2b7f86e 100644 --- a/pandas/tests/test_sorting.py +++ b/pandas/tests/test_sorting.py @@ -67,7 +67,6 @@ def test_int64_overflow(self): assert left[k] == v assert len(left) == len(right) - @pytest.mark.slow def test_int64_overflow_moar(self): # GH9096