summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_io.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2019-08-14 18:33:34 -0600
committerGitHub <noreply@github.com>2019-08-14 18:33:34 -0600
commit908fa68a1978ea0826f1761ea5688e8c58111ae9 (patch)
treebea8b8f647bb9ca2afb12c878db425c9e28494fb /numpy/lib/tests/test_io.py
parent5e7e74beb88e201e81db13fac7cc1d61014695f2 (diff)
parent99acd16d9582a78b11561108b63db3aacb042ccc (diff)
downloadnumpy-908fa68a1978ea0826f1761ea5688e8c58111ae9.tar.gz
Merge pull request #14252 from maxwell-aladago/genfromtext
BUG: Fixes StopIteration error from 'np.genfromtext' for empty file with skip_header > 0
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r--numpy/lib/tests/test_io.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index 78f9f85f3..407bb56bf 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -1681,6 +1681,10 @@ M 33 21.99
test = np.genfromtxt(data)
assert_equal(test, np.array([]))
+ # when skip_header > 0
+ test = np.genfromtxt(data, skip_header=1)
+ assert_equal(test, np.array([]))
+
def test_fancy_dtype_alt(self):
# Check that a nested dtype isn't MIA
data = TextIO('1,2,3.0\n4,5,6.0\n')