(self)
| 2568 | |
| 2569 | @pytest.mark.xfail(IS_WASM, reason="memmap doesn't work correctly") |
| 2570 | def test_save_load_memmap_readwrite(self): |
| 2571 | # Test that pathlib.Path instances can be written mem-mapped. |
| 2572 | with temppath(suffix='.npy') as path: |
| 2573 | path = Path(path) |
| 2574 | a = np.array([[1, 2], [3, 4]], int) |
| 2575 | np.save(path, a) |
| 2576 | b = np.load(path, mmap_mode='r+') |
| 2577 | a[0][0] = 5 |
| 2578 | b[0][0] = 5 |
| 2579 | del b # closes the file |
| 2580 | if IS_PYPY: |
| 2581 | break_cycles() |
| 2582 | break_cycles() |
| 2583 | data = np.load(path) |
| 2584 | assert_array_equal(data, a) |
| 2585 | |
| 2586 | def test_savez_load(self): |
| 2587 | # Test that pathlib.Path instances can be used with savez. |
nothing calls this directly
no test coverage detected