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

Function test_at_fail

tests/test_numpy_array.py:154–158  ·  view source on GitHub ↗
(arr, dim)

Source from the content-addressed store, hash-verified

152
153@pytest.mark.parametrize("dim", [0, 1, 3])
154def test_at_fail(arr, dim):
155 for func in m.at_t, m.mutate_at_t:
156 with pytest.raises(IndexError) as excinfo:
157 func(arr, *([0] * dim))
158 assert str(excinfo.value) == f"index dimension mismatch: {dim} (ndim = 2)"
159
160
161def test_at(arr):

Callers

nothing calls this directly

Calls 2

strClass · 0.85
funcFunction · 0.70

Tested by

no test coverage detected