(self)
| 2553 | assert_array_equal(data, a) |
| 2554 | |
| 2555 | def test_save_load_memmap(self): |
| 2556 | # Test that pathlib.Path instances can be loaded mem-mapped. |
| 2557 | with temppath(suffix='.npy') as path: |
| 2558 | path = Path(path) |
| 2559 | a = np.array([[1, 2], [3, 4]], int) |
| 2560 | np.save(path, a) |
| 2561 | data = np.load(path, mmap_mode='r') |
| 2562 | assert_array_equal(data, a) |
| 2563 | # close the mem-mapped file |
| 2564 | del data |
| 2565 | if IS_PYPY: |
| 2566 | break_cycles() |
| 2567 | break_cycles() |
| 2568 | |
| 2569 | @pytest.mark.xfail(IS_WASM, reason="memmap doesn't work correctly") |
| 2570 | def test_save_load_memmap_readwrite(self): |
nothing calls this directly
no test coverage detected