Skip to content

Commit 541d092

Browse files
authored
TST: Move xfail to its own test (#51079)
1 parent 87f069a commit 541d092

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pandas/tests/groupby/test_groupby.py

-8
Original file line numberDiff line numberDiff line change
@@ -2426,14 +2426,6 @@ def test_group_on_two_row_multiindex_returns_one_tuple_key():
24262426
(DataFrame, "group_keys", False),
24272427
(DataFrame, "observed", True),
24282428
(DataFrame, "dropna", False),
2429-
pytest.param(
2430-
Series,
2431-
"axis",
2432-
1,
2433-
marks=pytest.mark.xfail(
2434-
reason="GH 35443: Attribute currently not passed on to series"
2435-
),
2436-
),
24372429
(Series, "level", "a"),
24382430
(Series, "as_index", False),
24392431
(Series, "sort", False),

pandas/tests/groupby/test_raises.py

+8
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,11 @@ def func(x):
176176

177177
with pytest.raises(TypeError, match="Test error message"):
178178
getattr(gb, how)(func)
179+
180+
181+
def test_subsetting_columns_axis_1_raises():
182+
# GH 35443
183+
df = DataFrame({"a": [1], "b": [2], "c": [3]})
184+
gb = df.groupby("a", axis=1)
185+
with pytest.raises(ValueError, match="Cannot subset columns when using axis=1"):
186+
gb["b"]

0 commit comments

Comments
 (0)