diff --git a/pandas/tests/indexes/test_base.py b/pandas/tests/indexes/test_base.py index 5bfa13c0865f1..9d6dc3e906dff 100644 --- a/pandas/tests/indexes/test_base.py +++ b/pandas/tests/indexes/test_base.py @@ -507,7 +507,7 @@ def test_constructor_dtypes_timedelta(self, attr, klass): result = klass(list(values), dtype=dtype) tm.assert_index_equal(result, index) - @pytest.mark.parametrize("value", [[], iter([]), (x for x in [])]) + @pytest.mark.parametrize("value", [[], iter([]), (_ for _ in [])]) @pytest.mark.parametrize( "klass", [ @@ -530,7 +530,7 @@ def test_constructor_empty(self, value, klass): [ (PeriodIndex([], freq="B"), PeriodIndex), (PeriodIndex(iter([]), freq="B"), PeriodIndex), - (PeriodIndex((x for x in []), freq="B"), PeriodIndex), + (PeriodIndex((_ for _ in []), freq="B"), PeriodIndex), (RangeIndex(step=1), pd.RangeIndex), (MultiIndex(levels=[[1, 2], ["blue", "red"]], codes=[[], []]), MultiIndex), ], @@ -1733,22 +1733,22 @@ def test_slice_locs_na_raises(self): "in_slice,expected", [ (pd.IndexSlice[::-1], "yxdcb"), - (pd.IndexSlice["b":"y":-1], ""), - (pd.IndexSlice["b"::-1], "b"), - (pd.IndexSlice[:"b":-1], "yxdcb"), - (pd.IndexSlice[:"y":-1], "y"), - (pd.IndexSlice["y"::-1], "yxdcb"), - (pd.IndexSlice["y"::-4], "yb"), + (pd.IndexSlice["b":"y":-1], ""), # type: ignore + (pd.IndexSlice["b"::-1], "b"), # type: ignore + (pd.IndexSlice[:"b":-1], "yxdcb"), # type: ignore + (pd.IndexSlice[:"y":-1], "y"), # type: ignore + (pd.IndexSlice["y"::-1], "yxdcb"), # type: ignore + (pd.IndexSlice["y"::-4], "yb"), # type: ignore # absent labels - (pd.IndexSlice[:"a":-1], "yxdcb"), - (pd.IndexSlice[:"a":-2], "ydb"), - (pd.IndexSlice["z"::-1], "yxdcb"), - (pd.IndexSlice["z"::-3], "yc"), - (pd.IndexSlice["m"::-1], "dcb"), - (pd.IndexSlice[:"m":-1], "yx"), - (pd.IndexSlice["a":"a":-1], ""), - (pd.IndexSlice["z":"z":-1], ""), - (pd.IndexSlice["m":"m":-1], ""), + (pd.IndexSlice[:"a":-1], "yxdcb"), # type: ignore + (pd.IndexSlice[:"a":-2], "ydb"), # type: ignore + (pd.IndexSlice["z"::-1], "yxdcb"), # type: ignore + (pd.IndexSlice["z"::-3], "yc"), # type: ignore + (pd.IndexSlice["m"::-1], "dcb"), # type: ignore + (pd.IndexSlice[:"m":-1], "yx"), # type: ignore + (pd.IndexSlice["a":"a":-1], ""), # type: ignore + (pd.IndexSlice["z":"z":-1], ""), # type: ignore + (pd.IndexSlice["m":"m":-1], ""), # type: ignore ], ) def test_slice_locs_negative_step(self, in_slice, expected): diff --git a/setup.cfg b/setup.cfg index 46e6b88f8018a..fa8b61a214cab 100644 --- a/setup.cfg +++ b/setup.cfg @@ -148,9 +148,6 @@ ignore_errors=True [mypy-pandas.tests.indexes.datetimes.test_tools] ignore_errors=True -[mypy-pandas.tests.indexes.test_base] -ignore_errors=True - [mypy-pandas.tests.scalar.period.test_period] ignore_errors=True