diff options
Diffstat (limited to 'numpy/lib/tests/test_format.py')
-rw-r--r-- | numpy/lib/tests/test_format.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py index 46b21707f..ee845fc95 100644 --- a/numpy/lib/tests/test_format.py +++ b/numpy/lib/tests/test_format.py @@ -837,8 +837,15 @@ def test_large_file_support(): @dec.slow +@dec.skipif(np.dtype(np.intp).itemsize < 8, "test requires 64-bit system") def test_large_archive(): - a = np.empty((2 ** 30, 2), dtype=np.uint8) + # Regression test for product of saving arrays with dimensions of array + # having a product that doesn't fit in int32. See gh-7598 for details. + try: + a = np.empty((2**30, 2), dtype=np.uint8) + except MemoryError: + raise SkipTest("Could not create large file") + fname = os.path.join(tempdir, "large_archive") with open(fname, "wb") as f: @@ -847,7 +854,7 @@ def test_large_archive(): with open(fname, "rb") as f: new_a = np.load(f)["arr"] - assert a.shape == new_a.shape + assert_(a.shape == new_a.shape) if __name__ == "__main__": |