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

Method test_del

numpy/core/tests/test_memmap.py:108–120  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

106 fp.flush()
107
108 def test_del(self):
109 # Make sure a view does not delete the underlying mmap
110 fp_base = memmap(self.tmpfp, dtype=self.dtype, mode='w+',
111 shape=self.shape)
112 fp_base[0] = 5
113 fp_view = fp_base[0:1]
114 assert_equal(fp_view[0], 5)
115 del fp_view
116 # Should still be able to access and assign values after
117 # deleting the view
118 assert_equal(fp_base[0], 5)
119 fp_base[0] = 6
120 assert_equal(fp_base[0], 6)
121
122 def test_arithmetic_drops_references(self):
123 fp = memmap(self.tmpfp, dtype=self.dtype, mode='w+',

Callers

nothing calls this directly

Calls 2

memmapClass · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected