summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_format.py
diff options
context:
space:
mode:
authorJohn Zwinck <jzwinck@gmail.com>2018-07-07 10:14:46 +0800
committerJohn Zwinck <jzwinck@gmail.com>2018-07-07 10:16:23 +0800
commit4c74e384a7ec961d171b7d6a0fbf20b2bc831c28 (patch)
tree09f4e4b24dd3723e8180dce59a90211fbcc9939e /numpy/lib/tests/test_format.py
parent8eee9b7d3836b8d080b50e2dfb3ba98537a076c0 (diff)
downloadnumpy-4c74e384a7ec961d171b7d6a0fbf20b2bc831c28.tar.gz
BUG: fix np.load() of empty .npz file
Fixes #9989
Diffstat (limited to 'numpy/lib/tests/test_format.py')
-rw-r--r--numpy/lib/tests/test_format.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py
index 38a9b8000..f00961fef 100644
--- a/numpy/lib/tests/test_format.py
+++ b/numpy/lib/tests/test_format.py
@@ -852,3 +852,10 @@ def test_large_archive():
new_a = np.load(f)["arr"]
assert_(a.shape == new_a.shape)
+
+
+def test_empty_npz():
+ # Test for gh-9989
+ fname = os.path.join(tempdir, "nothing.npz")
+ np.savez(fname)
+ np.load(fname)