summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaron de Leeuw <jarondl@server.fake>2013-11-25 16:25:25 +0200
committerYaron de Leeuw <jarondl@server.fake>2014-02-28 09:18:16 +0200
commit3b99f376c9e2d128291c16a896a4b302b75020c1 (patch)
tree7311e96b3fd102d76ea2b3b9956ccff818ac3e75
parent803a75fca8e814b9ba46aef585eefeb94a16325d (diff)
downloadnumpy-3b99f376c9e2d128291c16a896a4b302b75020c1.tar.gz
TST: Added regression test for recfromcsv dtype error, as suggested by @hpaulj
-rw-r--r--numpy/lib/tests/test_io.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index a8b578097..418386e35 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -1572,6 +1572,14 @@ M 33 21.99
dtype=[('a', np.int), ('b', np.int)])
self.assertTrue(isinstance(test, np.recarray))
assert_equal(test, control)
+ #
+ data = TextIO('A,B\n0,1\n2,3')
+ dtype = [('a', np.int), ('b', np.float)]
+ test = np.recfromcsv(data, missing_values='N/A', dtype=dtype)
+ control = np.array([(0, 1), (2, 3)],
+ dtype=dtype)
+ self.assertTrue(isinstance(test, np.recarray))
+ assert_equal(test, control)
def test_gft_using_filename(self):
# Test that we can load data from a filename as well as a file object