Skip to content

Commit c487cab

Browse files
test also with named axis
1 parent 26e0f9a commit c487cab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/tests/apply/test_frame_apply.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,11 +1331,11 @@ def test_agg_reduce(axis, float_frame):
13311331

13321332

13331333
def test_named_agg_reduce_axis1_raises(float_frame):
1334-
axis = 1
13351334
name1, name2 = float_frame.axes[0].unique()[:2].sort_values()
1336-
msg = f"Named aggregation is not supported when {axis=}."
1337-
with pytest.raises(NotImplementedError, match=msg):
1338-
float_frame.agg(row1=(name1, "sum"), row2=(name2, "max"), axis=axis)
1335+
msg = "Named aggregation is not supported when axis=1."
1336+
for axis in [1, "columns"]:
1337+
with pytest.raises(NotImplementedError, match=msg):
1338+
float_frame.agg(row1=(name1, "sum"), row2=(name2, "max"), axis=axis)
13391339

13401340

13411341
def test_nuiscance_columns():

0 commit comments

Comments
 (0)