diff --git a/pandas/tests/groupby/test_groupby.py b/pandas/tests/groupby/test_groupby.py index e9b18836e003c..1a145c65a13a9 100644 --- a/pandas/tests/groupby/test_groupby.py +++ b/pandas/tests/groupby/test_groupby.py @@ -2426,14 +2426,6 @@ def test_group_on_two_row_multiindex_returns_one_tuple_key(): (DataFrame, "group_keys", False), (DataFrame, "observed", True), (DataFrame, "dropna", False), - pytest.param( - Series, - "axis", - 1, - marks=pytest.mark.xfail( - reason="GH 35443: Attribute currently not passed on to series" - ), - ), (Series, "level", "a"), (Series, "as_index", False), (Series, "sort", False), diff --git a/pandas/tests/groupby/test_raises.py b/pandas/tests/groupby/test_raises.py index cc3f468349efb..1c889e6ed457a 100644 --- a/pandas/tests/groupby/test_raises.py +++ b/pandas/tests/groupby/test_raises.py @@ -176,3 +176,11 @@ def func(x): with pytest.raises(TypeError, match="Test error message"): getattr(gb, how)(func) + + +def test_subsetting_columns_axis_1_raises(): + # GH 35443 + df = DataFrame({"a": [1], "b": [2], "c": [3]}) + gb = df.groupby("a", axis=1) + with pytest.raises(ValueError, match="Cannot subset columns when using axis=1"): + gb["b"]