diff options
author | Stefan van der Walt <stefan@sun.ac.za> | 2009-03-02 20:05:32 +0000 |
---|---|---|
committer | Stefan van der Walt <stefan@sun.ac.za> | 2009-03-02 20:05:32 +0000 |
commit | 553a30079c37ebecf8a37b9ee1fbf219d1d09053 (patch) | |
tree | 2da9d45c313a0b00c44e0122e6ff5e9af3edfe12 /numpy/lib/tests/test_io.py | |
parent | 97cc30a923b5907b0b51be44d315d883d7533153 (diff) | |
download | numpy-553a30079c37ebecf8a37b9ee1fbf219d1d09053.tar.gz |
Correctly handle gzip filenames in loadtxt.
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r-- | numpy/lib/tests/test_io.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index f545bfe34..d4f7f0e97 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -3,6 +3,7 @@ import numpy.ma as ma from numpy.ma.testutils import * import StringIO +import gzip from tempfile import NamedTemporaryFile import sys, time @@ -821,6 +822,13 @@ def test_gzip_load(): f = gzip.GzipFile(fileobj=s, mode="r") assert_array_equal(np.load(f), a) +def test_gzip_loadtxt(): + f = NamedTemporaryFile(suffix='.gz') + g = gzip.GzipFile(fileobj=f) + g.write('1 2 3\n') + g.close() + f.seek(0) + assert_array_equal(np.loadtxt(f.name), [1, 2, 3]) if __name__ == "__main__": run_module_suite() |