MCPcopy
hub / github.com/numpy/numpy / test_roundtrip

Method test_roundtrip

numpy/_core/tests/test_memmap.py:39–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

37 self.data = None
38
39 def test_roundtrip(self):
40 # Write data to file
41 fp = memmap(self.tmpfp, dtype=self.dtype, mode='w+',
42 shape=self.shape)
43 fp[:] = self.data[:]
44 del fp # Test __del__ machinery, which handles cleanup
45
46 # Read data back from file
47 newfp = memmap(self.tmpfp, dtype=self.dtype, mode='r',
48 shape=self.shape)
49 assert_(allclose(self.data, newfp))
50 assert_array_equal(self.data, newfp)
51 assert_equal(newfp.flags.writeable, False)
52
53 def test_open_with_filename(self, tmp_path):
54 tmpname = tmp_path / 'mmap'

Callers

nothing calls this directly

Calls 5

memmapClass · 0.90
assert_Function · 0.90
allcloseFunction · 0.90
assert_array_equalFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected