summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_io.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2008-07-22 06:37:48 +0000
committerCharles Harris <charlesr.harris@gmail.com>2008-07-22 06:37:48 +0000
commita2dcde587eb07398d0a30189a898c614ea1ba1aa (patch)
tree8c135ebad9b5e532df6f74f9a620dcde96035e81 /numpy/lib/tests/test_io.py
parente41b0e3b2222095c2eb75952602fc8b779798cbc (diff)
downloadnumpy-a2dcde587eb07398d0a30189a898c614ea1ba1aa.tar.gz
Apply Stefan's patch for Ryan's loadtext fix.
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r--numpy/lib/tests/test_io.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index 6ece0222f..c6a8498eb 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -232,6 +232,15 @@ class TestLoadTxt(TestCase):
assert_equal(arr['stid'], ["JOE", "BOB"])
assert_equal(arr['temp'], [25.3, 27.9])
+ def test_fancy_dtype(self):
+ c = StringIO.StringIO()
+ c.write('1,2,3.0\n4,5,6.0\n')
+ c.seek(0)
+ dt = np.dtype([('x', int), ('y', [('t', int), ('s', float)])])
+ x = np.loadtxt(c, dtype=dt, delimiter=',')
+ a = np.array([(1,(2,3.0)),(4,(5,6.0))], dt)
+ assert_array_equal(x, a)
+
class Testfromregex(TestCase):
def test_record(self):