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

Method test_view

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

Source from the content-addressed store, hash-verified

1781 zs.resize((10, 10))
1782
1783 def test_view(self):
1784 for dt in [bytes, np.void, str]:
1785 zs = self._zeros(10, dt)
1786
1787 # viewing as itself should be allowed
1788 assert_equal(zs.view(dt).dtype, np.dtype(dt))
1789
1790 # viewing as any non-empty type gives an empty result
1791 assert_equal(zs.view((dt, 1)).shape, (0,))
1792
1793 def test_dumps(self):
1794 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