diff --git a/pandas/tests/extension/json/test_json.py b/pandas/tests/extension/json/test_json.py index f3129a89124f4..b8df787b7214a 100644 --- a/pandas/tests/extension/json/test_json.py +++ b/pandas/tests/extension/json/test_json.py @@ -159,7 +159,7 @@ class TestConstructors(BaseJSON, base.BaseConstructorsTests): @pytest.mark.xfail(reason="not implemented constructor from dtype") def test_from_dtype(self, data): # construct from our dtype & string dtype - super(self).test_from_dtype(data) + super().test_from_dtype(data) @pytest.mark.xfail(reason="RecursionError, GH-33900") def test_series_constructor_no_data_with_index(self, dtype, na_value): diff --git a/pandas/tests/extension/test_sparse.py b/pandas/tests/extension/test_sparse.py index 0a2686a24c732..86a523404ef8b 100644 --- a/pandas/tests/extension/test_sparse.py +++ b/pandas/tests/extension/test_sparse.py @@ -268,7 +268,7 @@ def test_fillna_series_method(self, data_missing): @pytest.mark.xfail(reason="Unsupported") def test_fillna_series(self): # this one looks doable. - super(self).test_fillna_series() + super().test_fillna_series() def test_fillna_frame(self, data_missing): # Have to override to specify that fill_value will change. diff --git a/pandas/tests/generic/test_frame.py b/pandas/tests/generic/test_frame.py index b4a3a60e72139..c72e8158a0725 100644 --- a/pandas/tests/generic/test_frame.py +++ b/pandas/tests/generic/test_frame.py @@ -157,27 +157,25 @@ def test_validate_bool_args(self, value): msg = 'For argument "inplace" expected type bool, received type' with pytest.raises(ValueError, match=msg): - super(DataFrame, df).rename_axis( - mapper={"a": "x", "b": "y"}, axis=1, inplace=value - ) + df.copy().rename_axis(mapper={"a": "x", "b": "y"}, axis=1, inplace=value) with pytest.raises(ValueError, match=msg): - super(DataFrame, df).drop("a", axis=1, inplace=value) + df.copy().drop("a", axis=1, inplace=value) with pytest.raises(ValueError, match=msg): - super(DataFrame, df).fillna(value=0, inplace=value) + df.copy().fillna(value=0, inplace=value) with pytest.raises(ValueError, match=msg): - super(DataFrame, df).replace(to_replace=1, value=7, inplace=value) + df.copy().replace(to_replace=1, value=7, inplace=value) with pytest.raises(ValueError, match=msg): - super(DataFrame, df).interpolate(inplace=value) + df.copy().interpolate(inplace=value) with pytest.raises(ValueError, match=msg): - super(DataFrame, df)._where(cond=df.a > 2, inplace=value) + df.copy()._where(cond=df.a > 2, inplace=value) with pytest.raises(ValueError, match=msg): - super(DataFrame, df).mask(cond=df.a > 2, inplace=value) + df.copy().mask(cond=df.a > 2, inplace=value) def test_unexpected_keyword(self): # GH8597 diff --git a/pyproject.toml b/pyproject.toml index a1feba998bc50..1452d301703dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,6 @@ disable = [ "W", "abstract-class-instantiated", "access-member-before-definition", - "bad-super-call", "c-extension-no-member", "import-error", "invalid-repr-returned",