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

Method roundtrip

numpy/lib/tests/test_io.py:192–204  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

190
191class TestSavezLoad(RoundtripTest):
192 def roundtrip(self, *args, **kwargs):
193 RoundtripTest.roundtrip(self, np.savez, *args, **kwargs)
194 try:
195 for n, arr in enumerate(self.arr):
196 reloaded = self.arr_reloaded['arr_%d' % n]
197 assert_equal(arr, reloaded)
198 assert_equal(arr.dtype, reloaded.dtype)
199 assert_equal(arr.flags.fnc, reloaded.flags.fnc)
200 finally:
201 # delete tempfile, must be done here on windows
202 if self.arr_reloaded.fid:
203 self.arr_reloaded.fid.close()
204 os.remove(self.arr_reloaded.fid.name)
205
206 @pytest.mark.skipif(IS_PYPY, reason="Hangs on PyPy")
207 @pytest.mark.skipif(not IS_64BIT, reason="Needs 64bit platform")

Callers 1

test_multiple_arraysMethod · 0.95

Calls 3

assert_equalFunction · 0.90
roundtripMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected