| 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 |