summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_io.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r--numpy/lib/tests/test_io.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index 30c0998dc..f9d5569de 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -485,6 +485,13 @@ class TestLoadTxt(TestCase):
e = StringIO()
assert_(np.loadtxt(e, ndmin=2).shape == (0, 1,))
+ def test_generator_source(self):
+ def count():
+ for i in range(10):
+ yield "%d" % i
+
+ res = np.loadtxt(count())
+ assert_array_equal(res, np.arange(10))
class Testfromregex(TestCase):
def test_record(self):