Skip to content

Commit ad4f563

Browse files
committed
Tests for idx.array and idx.values immutability
1 parent 48146ad commit ad4f563

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/tests/indexes/test_any_index.py

+14
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ def test_mutability(index):
3333
index[0] = index[0]
3434

3535

36+
def test_values_mutability(index):
37+
if not len(index):
38+
return
39+
with pytest.raises(ValueError):
40+
index.values[0] = index[0]
41+
42+
43+
def test_array_mutability(index):
44+
if not len(index):
45+
return
46+
with pytest.raises(ValueError):
47+
index.array[0] = index[0]
48+
49+
3650
def test_wrong_number_names(index):
3751
names = index.nlevels * ["apple", "banana", "carrot"]
3852
with pytest.raises(ValueError, match="^Length"):

0 commit comments

Comments
 (0)