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

Method test_obj_obj

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

Source from the content-addressed store, hash-verified

5887
5888 @_no_tracing
5889 def test_obj_obj(self):
5890 # check memory is initialized on resize, gh-4857
5891 a = np.ones(10, dtype=[('k', object, 2)])
5892 if IS_PYPY:
5893 a.resize(15, refcheck=False)
5894 else:
5895 a.resize(15,)
5896 assert_equal(a.shape, (15,))
5897 assert_array_equal(a['k'][-5:], 0)
5898 assert_array_equal(a['k'][:-5], 1)
5899
5900 def test_empty_view(self):
5901 # check that sizes containing a zero don't trigger a reallocate for

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
assert_array_equalFunction · 0.90
resizeMethod · 0.45

Tested by

no test coverage detected