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

Method test_priority_with_scalar

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

Source from the content-addressed store, hash-verified

3320 assert_array_equal(x, np.array((1, 2, 3)))
3321
3322 def test_priority_with_scalar(self):
3323 # test fix for bug #826:
3324
3325 class A(np.ndarray):
3326 __array_priority__ = 10
3327
3328 def __new__(cls):
3329 return np.asarray(1.0, 'float64').view(cls).copy()
3330
3331 a = A()
3332 x = np.float64(1) * a
3333 assert_(isinstance(x, A))
3334 assert_array_equal(x, np.array(1))
3335
3336 def test_priority(self):
3337

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