diff options
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r-- | numpy/lib/tests/test_io.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index f9da258dc..18585375e 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -5,6 +5,7 @@ import threading from tempfile import mkstemp, NamedTemporaryFile import time from datetime import datetime +import warnings import numpy as np import numpy.ma as ma @@ -637,7 +638,6 @@ class TestFromTxt(TestCase): assert_equal(test, ctrl) def test_skip_footer_with_invalid(self): - import warnings basestr = '1 1\n2 2\n3 3\n4 4\n5 \n6 \n7 \n' warnings.filterwarnings("ignore") # Footer too small to get rid of all invalid values @@ -959,12 +959,12 @@ M 33 21.99 usecols=('a', 'c'), **kwargs) assert_equal(test, ctrl) - def test_empty_file(self): - "Test that an empty file raises the proper exception" + "Test that an empty file raises the proper warning." + warnings.filterwarnings("ignore", message="genfromtxt: Empty input file:") data = StringIO() - assert_raises(IOError, np.ndfromtxt, data) - + test = np.genfromtxt(data) + assert_equal(test, np.array([])) def test_fancy_dtype_alt(self): "Check that a nested dtype isn't MIA" @@ -1440,5 +1440,6 @@ def test_npzfile_dict(): assert_('x' in list(z.iterkeys())) + if __name__ == "__main__": run_module_suite() |