From 6db785f245fbe3b38d33c554490bbec4a22e84da Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 30 Jul 2021 09:30:23 -0700 Subject: [PATCH] CI: catch warning produced in resample --- pandas/tests/resample/test_resample_api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandas/tests/resample/test_resample_api.py b/pandas/tests/resample/test_resample_api.py index 76ac86d798086..addd6c17809a2 100644 --- a/pandas/tests/resample/test_resample_api.py +++ b/pandas/tests/resample/test_resample_api.py @@ -349,7 +349,12 @@ def test_agg(): expected = pd.concat([a_mean, a_std, b_mean, b_std], axis=1) expected.columns = pd.MultiIndex.from_product([["A", "B"], ["mean", "std"]]) for t in cases: - result = t.aggregate([np.mean, np.std]) + warn = FutureWarning if t in cases[1:3] else None + with tm.assert_produces_warning( + warn, match="Dropping invalid columns", check_stacklevel=False + ): + # .var on dt64 column raises and is dropped + result = t.aggregate([np.mean, np.std]) tm.assert_frame_equal(result, expected) expected = pd.concat([a_mean, b_std], axis=1)