MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_mutate_readonly

Function test_mutate_readonly

tests/test_numpy_array.py:169–178  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

167
168
169def test_mutate_readonly(arr):
170 arr.flags.writeable = False
171 for func, args in (
172 (m.mutate_data, ()),
173 (m.mutate_data_t, ()),
174 (m.mutate_at_t, (0, 0)),
175 ):
176 with pytest.raises(ValueError) as excinfo:
177 func(arr, *args)
178 assert str(excinfo.value) == "array is not writeable"
179
180
181def test_mutate_data(arr):

Callers

nothing calls this directly

Calls 2

strClass · 0.85
funcFunction · 0.70

Tested by

no test coverage detected