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

Method test_no_wrapper

numpy/_core/tests/test_overrides.py:198–206  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

196 assert_equal(result, expected.view(OverrideSub))
197
198 def test_no_wrapper(self):
199 # Regular numpy functions have wrappers, but do not presume
200 # all functions do (array creation ones do not): check that
201 # we just call the function in that case.
202 array = np.array(1)
203 func = lambda x: x * 2
204 result = array.__array_function__(func=func, types=(np.ndarray,),
205 args=(array,), kwargs={})
206 assert_equal(result, array * 2)
207
208 def test_wrong_arguments(self):
209 # Check our implementation guards against wrong arguments.

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
__array_function__Method · 0.45

Tested by

no test coverage detected