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

Function test_buffer_exception

tests/test_buffers.py:237–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

235
236
237def test_buffer_exception():
238 with pytest.raises(BufferError, match="Error getting buffer") as excinfo:
239 memoryview(m.BrokenMatrix(1, 1))
240 assert isinstance(excinfo.value.__cause__, RuntimeError)
241 assert "for context" in str(excinfo.value.__cause__)
242
243
244@pytest.mark.parametrize("type", ["pybind11", "numpy"])

Callers

nothing calls this directly

Calls 4

memoryviewClass · 0.85
isinstanceFunction · 0.85
strClass · 0.85
BrokenMatrixMethod · 0.80

Tested by

no test coverage detected