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

Method test_priority_with_scalar

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

Source from the content-addressed store, hash-verified

3025 assert_array_equal(x, np.array((1, 2, 3)))
3026
3027 def test_priority_with_scalar(self):
3028 # test fix for bug #826:
3029
3030 class A(np.ndarray):
3031 __array_priority__ = 10
3032
3033 def __new__(cls):
3034 return np.asarray(1.0, 'float64').view(cls).copy()
3035
3036 a = A()
3037 x = np.float64(1)*a
3038 assert_(isinstance(x, A))
3039 assert_array_equal(x, np.array(1))
3040
3041 def test_old_wrap(self):
3042

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
assert_array_equalFunction · 0.90
AClass · 0.70

Tested by

no test coverage detected