MCPcopy Index your code
hub / github.com/numpy/numpy / test_failing_wrap

Method test_failing_wrap

numpy/_core/tests/test_umath.py:3379–3390  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3377 assert_(type(ncu.exp(c) is C))
3378
3379 def test_failing_wrap(self):
3380
3381 class A:
3382 def __array__(self, dtype=None, copy=None):
3383 return np.zeros(2)
3384
3385 def __array_wrap__(self, arr, context, return_scalar):
3386 raise RuntimeError
3387
3388 a = A()
3389 assert_raises(RuntimeError, ncu.maximum, a, a)
3390 assert_raises(RuntimeError, ncu.maximum.reduce, a)
3391
3392 def test_failing_out_wrap(self):
3393

Callers

nothing calls this directly

Calls 2

assert_raisesFunction · 0.90
AClass · 0.70

Tested by

no test coverage detected