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

Method test_not_closing_opened_fid

numpy/lib/tests/test_io.py:281–294  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

279 raise AssertionError(errors)
280
281 def test_not_closing_opened_fid(self):
282 # Test that issue #2178 is fixed:
283 # verify could seek on 'loaded' file
284 with temppath(suffix='.npz') as tmp:
285 with open(tmp, 'wb') as fp:
286 np.savez(fp, data='LOVELY LOAD')
287 with open(tmp, 'rb', 10000) as fp:
288 fp.seek(0)
289 assert_(not fp.closed)
290 np.load(fp)['data']
291 # fp must not get closed by .load
292 assert_(not fp.closed)
293 fp.seek(0)
294 assert_(not fp.closed)
295
296 @pytest.mark.slow_pypy
297 def test_closing_fid(self):

Callers

nothing calls this directly

Calls 4

temppathFunction · 0.90
assert_Function · 0.90
openFunction · 0.85
seekMethod · 0.80

Tested by

no test coverage detected