Skip to content

Commit c01c14b

Browse files
committed
Tests for idx.array and idx.values immutability
1 parent 8095eb4 commit c01c14b

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
@@ -34,6 +34,20 @@ def test_mutability(indices):
3434
indices[0] = indices[0]
3535

3636

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

0 commit comments

Comments
 (0)