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

Method test_no_wrapper

numpy/core/tests/test_overrides.py:195–203  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

193 assert_equal(result, expected.view(OverrideSub))
194
195 def test_no_wrapper(self):
196 # This shouldn't happen unless a user intentionally calls
197 # __array_function__ with invalid arguments, but check that we raise
198 # an appropriate error all the same.
199 array = np.array(1)
200 func = lambda x: x
201 with assert_raises_regex(AttributeError, '_implementation'):
202 array.__array_function__(func=func, types=(np.ndarray,),
203 args=(array,), kwargs={})
204
205
206class TestArrayFunctionDispatch:

Callers

nothing calls this directly

Calls 2

assert_raises_regexFunction · 0.90
__array_function__Method · 0.45

Tested by

no test coverage detected