Skip to content

Commit 2e839c8

Browse files
committed
test invalid setitem
1 parent f003e98 commit 2e839c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/indexes/test_indexes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,3 +1557,9 @@ def test_index_droplevel() -> None:
15571557
check(assert_type(mi.droplevel(["elk"]), pd.MultiIndex | pd.Index), pd.Index)
15581558
check(assert_type(mi.droplevel(("elk",)), pd.MultiIndex | pd.Index), pd.Index)
15591559
check(assert_type(mi.droplevel(0), pd.MultiIndex | pd.Index), pd.Index)
1560+
1561+
1562+
def test_index_setitem() -> None:
1563+
idx = pd.Index([1, 2])
1564+
if TYPE_CHECKING_INVALID_USAGE:
1565+
idx[0] = 999 # type: ignore[index] # pyright: ignore[reportIndexIssue]

0 commit comments

Comments
 (0)