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

Method test_recarray_tolist

numpy/core/tests/test_regression.py:1180–1188  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1178 assert_(type(dat.nonzero()[1]) is np.ndarray)
1179
1180 def test_recarray_tolist(self):
1181 # Ticket #793, changeset r5215
1182 # Comparisons fail for NaN, so we can't use random memory
1183 # for the test.
1184 buf = np.zeros(40, dtype=np.int8)
1185 a = np.recarray(2, formats="i4,f8,f8", names="id,x,y", buf=buf)
1186 b = a.tolist()
1187 assert_( a[0].tolist() == b[0])
1188 assert_( a[1].tolist() == b[1])
1189
1190 def test_nonscalar_item_method(self):
1191 # Make sure that .item() fails graciously when it should

Callers

nothing calls this directly

Calls 2

assert_Function · 0.90
tolistMethod · 0.45

Tested by

no test coverage detected