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

Method test_view

numpy/_core/tests/test_multiarray.py:1994–2002  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1992 zs.resize((10, 10))
1993
1994 def test_view(self):
1995 for dt in [bytes, np.void, str]:
1996 zs = self._zeros(10, dt)
1997
1998 # viewing as itself should be allowed
1999 assert_equal(zs.view(dt).dtype, np.dtype(dt))
2000
2001 # viewing as any non-empty type gives an empty result
2002 assert_equal(zs.view((dt, 1)).shape, (0,))
2003
2004 def test_dumps(self):
2005 zs = self._zeros(10, int)

Callers

nothing calls this directly

Calls 4

_zerosMethod · 0.95
assert_equalFunction · 0.90
viewMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected