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

Method test_default_prepare

numpy/core/tests/test_umath.py:3143–3157  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3141 assert_equal(ncu.maximum(a, a), None)
3142
3143 def test_default_prepare(self):
3144
3145 class with_wrap:
3146 __array_priority__ = 10
3147
3148 def __array__(self):
3149 return np.zeros(1)
3150
3151 def __array_wrap__(self, arr, context):
3152 return arr
3153
3154 a = with_wrap()
3155 x = ncu.minimum(a, a)
3156 assert_equal(x, np.zeros(1))
3157 assert_equal(type(x), np.ndarray)
3158
3159 @pytest.mark.parametrize("use_where", [True, False])
3160 def test_prepare(self, use_where):

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
with_wrapClass · 0.85

Tested by

no test coverage detected