diff --git a/pandas/tests/extension/test_floating.py b/pandas/tests/extension/test_floating.py index ff0ff7399e3e6..0d88822009a90 100644 --- a/pandas/tests/extension/test_floating.py +++ b/pandas/tests/extension/test_floating.py @@ -211,5 +211,6 @@ class TestParsing(base.BaseParsingTests): pass +@pytest.mark.filterwarnings("ignore:overflow encountered in reduce:RuntimeWarning") class Test2DCompat(base.Dim2CompatTests): pass diff --git a/pandas/tests/frame/methods/test_combine_first.py b/pandas/tests/frame/methods/test_combine_first.py index c71b688d390d4..f841b763863d2 100644 --- a/pandas/tests/frame/methods/test_combine_first.py +++ b/pandas/tests/frame/methods/test_combine_first.py @@ -3,6 +3,9 @@ import numpy as np import pytest +from pandas.compat import pa_version_under7p0 +from pandas.errors import PerformanceWarning + from pandas.core.dtypes.cast import ( find_common_type, is_dtype_equal, @@ -387,12 +390,24 @@ def test_combine_first_string_dtype_only_na(self, nullable_string_dtype): {"a": ["962", "85"], "b": [pd.NA] * 2}, dtype=nullable_string_dtype ) df2 = DataFrame({"a": ["85"], "b": [pd.NA]}, dtype=nullable_string_dtype) - df = df.set_index(["a", "b"], copy=False) - df2 = df2.set_index(["a", "b"], copy=False) + with tm.maybe_produces_warning( + PerformanceWarning, + pa_version_under7p0 and nullable_string_dtype == "string[pyarrow]", + ): + df = df.set_index(["a", "b"], copy=False) + with tm.maybe_produces_warning( + PerformanceWarning, + pa_version_under7p0 and nullable_string_dtype == "string[pyarrow]", + ): + df2 = df2.set_index(["a", "b"], copy=False) result = df.combine_first(df2) - expected = DataFrame( - {"a": ["962", "85"], "b": [pd.NA] * 2}, dtype=nullable_string_dtype - ).set_index(["a", "b"]) + with tm.maybe_produces_warning( + PerformanceWarning, + pa_version_under7p0 and nullable_string_dtype == "string[pyarrow]", + ): + expected = DataFrame( + {"a": ["962", "85"], "b": [pd.NA] * 2}, dtype=nullable_string_dtype + ).set_index(["a", "b"]) tm.assert_frame_equal(result, expected) diff --git a/pandas/tests/frame/methods/test_quantile.py b/pandas/tests/frame/methods/test_quantile.py index 14b416011b956..3beb201bcfa05 100644 --- a/pandas/tests/frame/methods/test_quantile.py +++ b/pandas/tests/frame/methods/test_quantile.py @@ -751,6 +751,9 @@ def test_quantile_empty_no_rows_ints(self, interp_method): exp = Series([np.nan, np.nan], index=["a", "b"], name=0.5) tm.assert_series_equal(res, exp) + @pytest.mark.filterwarnings( + "ignore:The behavior of DatetimeArray._from_sequence:FutureWarning" + ) def test_quantile_empty_no_rows_dt64(self, interp_method): interpolation, method = interp_method # datetimes diff --git a/pandas/tests/test_expressions.py b/pandas/tests/test_expressions.py index a0066ace17bc4..e03194227f576 100644 --- a/pandas/tests/test_expressions.py +++ b/pandas/tests/test_expressions.py @@ -173,7 +173,7 @@ def testit(): with warnings.catch_warnings(): # array has 0s - msg = "invalid value encountered in true_divide" + msg = "invalid value encountered in divide|true_divide" warnings.filterwarnings("ignore", msg, RuntimeWarning) result = expr.evaluate(op, left, left, use_numexpr=True) expected = expr.evaluate(op, left, left, use_numexpr=False)