Skip to content

Commit

Permalink
Fix mypy error in pandas/tests.indexes.test_base.py (#29188)
Browse files Browse the repository at this point in the history
  • Loading branch information
rushabh-v authored and WillAyd committed Nov 27, 2019
1 parent 896dbc3 commit 6d3a08a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
34 changes: 17 additions & 17 deletions pandas/tests/indexes/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
[
Expand All @@ -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),
],
Expand Down Expand Up @@ -1726,22 +1726,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):
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6d3a08a

Please sign in to comment.