MCPcopy Create free account
hub / github.com/numpy/numpy / test_broadcast_to_raises

Function test_broadcast_to_raises

numpy/lib/tests/test_stride_tricks.py:260–276  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

258
259
260def test_broadcast_to_raises():
261 data = [
262 [(0,), ()],
263 [(1,), ()],
264 [(3,), ()],
265 [(3,), (1,)],
266 [(3,), (2,)],
267 [(3,), (4,)],
268 [(1, 2), (2, 1)],
269 [(1, 1), (1,)],
270 [(1,), -1],
271 [(1,), (-1,)],
272 [(1, 2), (-1, 2)],
273 ]
274 for orig_shape, target_shape in data:
275 arr = np.zeros(orig_shape)
276 assert_raises(ValueError, lambda: broadcast_to(arr, target_shape))
277
278
279def test_broadcast_shape():

Callers

nothing calls this directly

Calls 2

assert_raisesFunction · 0.90
broadcast_toFunction · 0.90

Tested by

no test coverage detected