| 154 | |
| 155 | |
| 156 | def test_bounds_check(arr): |
| 157 | for func in ( |
| 158 | m.index_at, |
| 159 | m.index_at_t, |
| 160 | m.data, |
| 161 | m.data_t, |
| 162 | m.mutate_data, |
| 163 | m.mutate_data_t, |
| 164 | m.at_t, |
| 165 | m.mutate_at_t, |
| 166 | ): |
| 167 | with pytest.raises(IndexError) as excinfo: |
| 168 | func(arr, 2, 0) |
| 169 | assert str(excinfo.value) == "index 2 is out of bounds for axis 0 with size 2" |
| 170 | with pytest.raises(IndexError) as excinfo: |
| 171 | func(arr, 0, 4) |
| 172 | assert str(excinfo.value) == "index 4 is out of bounds for axis 1 with size 3" |
| 173 | |
| 174 | |
| 175 | def test_make_c_f_array(): |