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

Function test_readonly_buffer

tests/test_buffers.py:156–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154
155
156def test_readonly_buffer():
157 buf = m.BufferReadOnly(0x64)
158 view = memoryview(buf)
159 assert view[0] == 0x64
160 assert view.readonly
161 with pytest.raises(TypeError):
162 view[0] = 0
163
164
165def test_selective_readonly_buffer():

Callers

nothing calls this directly

Calls 2

memoryviewClass · 0.85
BufferReadOnlyMethod · 0.80

Tested by

no test coverage detected