diff options
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r-- | numpy/lib/tests/test_io.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index 25309316e..f545bfe34 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -805,7 +805,21 @@ M 33 21.99 self.failUnless(isinstance(test, np.recarray)) assert_equal(test, control) +def test_gzip_load(): + import gzip + from StringIO import StringIO + a = np.random.random((5, 5)) + + s = StringIO() + f = gzip.GzipFile(fileobj=s, mode="w") + + np.save(f, a) + f.close() + s.seek(0) + + f = gzip.GzipFile(fileobj=s, mode="r") + assert_array_equal(np.load(f), a) if __name__ == "__main__": |