MCPcopy Index your code
hub / github.com/numpy/numpy / test_not_closing_opened_fid

Method test_not_closing_opened_fid

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

Source from the content-addressed store, hash-verified

302 raise AssertionError(errors)
303
304 def test_not_closing_opened_fid(self):
305 # Test that issue #2178 is fixed:
306 # verify could seek on 'loaded' file
307 with temppath(suffix='.npz') as tmp:
308 with open(tmp, 'wb') as fp:
309 np.savez(fp, data='LOVELY LOAD')
310 with open(tmp, 'rb', 10000) as fp:
311 fp.seek(0)
312 assert_(not fp.closed)
313 np.load(fp)['data']
314 # fp must not get closed by .load
315 assert_(not fp.closed)
316 fp.seek(0)
317 assert_(not fp.closed)
318
319 def test_closing_fid(self):
320 # Test that issue #1517 (too many opened files) remains closed

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