summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_format.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2016-05-15 10:47:59 +0200
committerRalf Gommers <ralf.gommers@gmail.com>2016-05-16 09:32:44 +0200
commit4f0f3528fd3aa90d99abb658eb5d35896ba8c449 (patch)
treef245855b64bbf3bfa1d174169ed606ce96d5773b /numpy/lib/tests/test_format.py
parent1e8d544a4adc396813b61b93611f5f41f147de56 (diff)
downloadnumpy-4f0f3528fd3aa90d99abb658eb5d35896ba8c449.tar.gz
TST: fix test error when saving large array with savez.
Diffstat (limited to 'numpy/lib/tests/test_format.py')
-rw-r--r--numpy/lib/tests/test_format.py11
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__":