Skip to content

Commit 1e5fee8

Browse files
authored
CI: Catch FutureWarnings (#49287)
1 parent c0b1800 commit 1e5fee8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pandas/tests/frame/test_reductions.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,15 @@ class TestDataFrameAnalytics:
168168
],
169169
)
170170
def test_stat_op_api_float_string_frame(self, float_string_frame, axis, opname):
171-
getattr(float_string_frame, opname)(axis=axis)
171+
if opname in ["sum", "min", "max"] and axis == 0:
172+
warn = None
173+
elif opname not in ["count", "nunique"]:
174+
warn = FutureWarning
175+
else:
176+
warn = None
177+
msg = "nuisance columns|default value of numeric_only"
178+
with tm.assert_produces_warning(warn, match=msg):
179+
getattr(float_string_frame, opname)(axis=axis)
172180
if opname != "nunique":
173181
getattr(float_string_frame, opname)(axis=axis, numeric_only=True)
174182

0 commit comments

Comments
 (0)