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

Method test_trace_subclass

numpy/core/tests/test_multiarray.py:3406–3414  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3404 assert ret is out
3405
3406 def test_trace_subclass(self):
3407 # The class would need to overwrite trace to ensure single-element
3408 # output also has the right subclass.
3409 class MyArray(np.ndarray):
3410 pass
3411
3412 b = np.arange(8).reshape((2, 2, 2)).view(MyArray)
3413 t = b.trace()
3414 assert_(isinstance(t, MyArray))
3415
3416 def test_put(self):
3417 icodes = np.typecodes['AllInteger']

Callers

nothing calls this directly

Calls 4

assert_Function · 0.90
reshapeMethod · 0.80
traceMethod · 0.80
viewMethod · 0.45

Tested by

no test coverage detected