diff --git a/tests/test_frame.py b/tests/test_frame.py index 53b581e6d..fe5370149 100644 --- a/tests/test_frame.py +++ b/tests/test_frame.py @@ -2670,12 +2670,20 @@ def test_frame_reindex_like() -> None: # GH 84 df = pd.DataFrame({"a": [1, 2, 3]}, index=[0, 1, 2]) other = pd.DataFrame({"a": [1, 2]}, index=[1, 0]) - check( - assert_type( - df.reindex_like(other, method="nearest", tolerance=[0.5, 0.2]), pd.DataFrame - ), - pd.DataFrame, - ) + + with pytest_warns_bounded( + FutureWarning, + "the 'method' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'method'", + lower="2.2.99", + upper="3.0.99", + ): + check( + assert_type( + df.reindex_like(other, method="nearest", tolerance=[0.5, 0.2]), + pd.DataFrame, + ), + pd.DataFrame, + ) def test_frame_ndarray_assignmment() -> None: diff --git a/tests/test_series.py b/tests/test_series.py index 03269ad46..517381025 100644 --- a/tests/test_series.py +++ b/tests/test_series.py @@ -3574,14 +3574,20 @@ def test_series_reindex() -> None: def test_series_reindex_like() -> None: s = pd.Series([1, 2, 3], index=[0, 1, 2]) other = pd.Series([1, 2], index=[1, 0]) - check( - assert_type( - s.reindex_like(other, method="nearest", tolerance=[0.5, 0.2]), - "pd.Series[int]", - ), - pd.Series, - np.integer, - ) + with pytest_warns_bounded( + FutureWarning, + "the 'method' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'method'", + lower="2.2.99", + upper="3.0.99", + ): + check( + assert_type( + s.reindex_like(other, method="nearest", tolerance=[0.5, 0.2]), + "pd.Series[int]", + ), + pd.Series, + np.integer, + ) def test_info() -> None: