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

Function test_dim_check_fail

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

Source from the content-addressed store, hash-verified

118
119
120def test_dim_check_fail(arr):
121 for func in (
122 m.index_at,
123 m.index_at_t,
124 m.offset_at,
125 m.offset_at_t,
126 m.data,
127 m.data_t,
128 m.mutate_data,
129 m.mutate_data_t,
130 ):
131 with pytest.raises(IndexError) as excinfo:
132 func(arr, 1, 2, 3)
133 assert str(excinfo.value) == "too many indices for an array: 3 (ndim = 2)"
134
135
136@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

strClass · 0.85
funcFunction · 0.70

Tested by

no test coverage detected