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

Method test_0d_shape

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

Source from the content-addressed store, hash-verified

5849 assert_array_equal(x, np.eye(3))
5850
5851 def test_0d_shape(self):
5852 # to it multiple times to test it does not break alloc cache gh-9216
5853 for i in range(10):
5854 x = np.empty((1,))
5855 x.resize(())
5856 assert_equal(x.shape, ())
5857 assert_equal(x.size, 1)
5858 x = np.empty(())
5859 x.resize((1,))
5860 assert_equal(x.shape, (1,))
5861 assert_equal(x.size, 1)
5862
5863 def test_invalid_arguments(self):
5864 assert_raises(TypeError, np.eye(3).resize, 'hi')

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
resizeMethod · 0.45

Tested by

no test coverage detected