diff --git a/pandas/tests/arithmetic/conftest.py b/pandas/tests/arithmetic/conftest.py index c20a9567e9ff8..8b9e5cd371a90 100644 --- a/pandas/tests/arithmetic/conftest.py +++ b/pandas/tests/arithmetic/conftest.py @@ -231,22 +231,6 @@ def box(request): return request.param -@pytest.fixture( - params=[ - pd.Index, - pd.Series, - pytest.param(pd.DataFrame, marks=pytest.mark.xfail), - tm.to_array, - ], - ids=id_func, -) -def box_df_fail(request): - """ - Fixture equivalent to `box` fixture but xfailing the DataFrame case. - """ - return request.param - - @pytest.fixture(params=[pd.Index, pd.Series, pd.DataFrame, tm.to_array], ids=id_func) def box_with_array(request): """ diff --git a/pandas/tests/arithmetic/test_interval.py b/pandas/tests/arithmetic/test_interval.py index d7c312b2fda1b..66526204a6208 100644 --- a/pandas/tests/arithmetic/test_interval.py +++ b/pandas/tests/arithmetic/test_interval.py @@ -126,12 +126,15 @@ def test_compare_scalar_interval_mixed_closed(self, op, closed, other_closed): expected = self.elementwise_comparison(op, array, other) tm.assert_numpy_array_equal(result, expected) - def test_compare_scalar_na(self, op, array, nulls_fixture): + def test_compare_scalar_na(self, op, array, nulls_fixture, request): result = op(array, nulls_fixture) expected = self.elementwise_comparison(op, array, nulls_fixture) - if nulls_fixture is pd.NA and array.dtype != pd.IntervalDtype("int"): - pytest.xfail("broken for non-integer IntervalArray; see GH 31882") + if nulls_fixture is pd.NA and array.dtype != pd.IntervalDtype("int64"): + mark = pytest.mark.xfail( + reason="broken for non-integer IntervalArray; see GH 31882" + ) + request.node.add_marker(mark) tm.assert_numpy_array_equal(result, expected) @@ -207,13 +210,15 @@ def test_compare_list_like_object(self, op, array, other): expected = self.elementwise_comparison(op, array, other) tm.assert_numpy_array_equal(result, expected) - def test_compare_list_like_nan(self, op, array, nulls_fixture): + def test_compare_list_like_nan(self, op, array, nulls_fixture, request): other = [nulls_fixture] * 4 result = op(array, other) expected = self.elementwise_comparison(op, array, other) - if nulls_fixture is pd.NA: - pytest.xfail("broken for non-integer IntervalArray; see GH 31882") + if nulls_fixture is pd.NA and array.dtype.subtype != "i8": + reason = "broken for non-integer IntervalArray; see GH 31882" + mark = pytest.mark.xfail(reason=reason) + request.node.add_marker(mark) tm.assert_numpy_array_equal(result, expected) diff --git a/pandas/tests/indexes/test_index_new.py b/pandas/tests/indexes/test_index_new.py index 87df5959e6221..9248c185bccd7 100644 --- a/pandas/tests/indexes/test_index_new.py +++ b/pandas/tests/indexes/test_index_new.py @@ -83,7 +83,7 @@ def test_constructor_infer_periodindex(self): ], ) def test_constructor_infer_nat_dt_like( - self, pos, klass, dtype, ctor, nulls_fixture + self, pos, klass, dtype, ctor, nulls_fixture, request ): expected = klass([NaT, NaT]) assert expected.dtype == dtype @@ -92,7 +92,8 @@ def test_constructor_infer_nat_dt_like( if nulls_fixture is NA: expected = Index([NA, NaT]) - pytest.xfail("Broken with np.NaT ctor; see GH 31884") + mark = pytest.mark.xfail(reason="Broken with np.NaT ctor; see GH 31884") + request.node.add_marker(mark) result = Index(data) tm.assert_index_equal(result, expected) diff --git a/pandas/tests/io/test_common.py b/pandas/tests/io/test_common.py index 84bc29ebc65e0..b27b028694d20 100644 --- a/pandas/tests/io/test_common.py +++ b/pandas/tests/io/test_common.py @@ -235,6 +235,11 @@ def test_read_expands_user_home_dir( ), ], ) + @pytest.mark.filterwarnings( + "ignore:This method will be removed in future versions. " + r"Use 'tree.iter\(\)' or 'list\(tree.iter\(\)\)' instead." + ":PendingDeprecationWarning" + ) def test_read_fspath_all(self, reader, module, path, datapath): pytest.importorskip(module) path = datapath(*path) diff --git a/pandas/tests/plotting/test_datetimelike.py b/pandas/tests/plotting/test_datetimelike.py index b85a2affc4e4b..7dcb692e29337 100644 --- a/pandas/tests/plotting/test_datetimelike.py +++ b/pandas/tests/plotting/test_datetimelike.py @@ -1456,7 +1456,9 @@ def test_add_matplotlib_datetime64(self): # ax.xaxis.converter with a DatetimeConverter s = Series(np.random.randn(10), index=date_range("1970-01-02", periods=10)) ax = s.plot() - ax.plot(s.index, s.values, color="g") + with tm.assert_produces_warning(DeprecationWarning): + # multi-dimensional indexing + ax.plot(s.index, s.values, color="g") l1, l2 = ax.lines tm.assert_numpy_array_equal(l1.get_xydata(), l2.get_xydata())