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