summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_io.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index 9cccbe041..d257b5423 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -258,6 +258,17 @@ class TestLoadTxt(TestCase):
c = StringIO.StringIO()
assert_raises(IOError, np.loadtxt, c)
+ def test_unused_converter(self):
+ c = StringIO.StringIO()
+ c.writelines(['1 21\n', '3 42\n'])
+ c.seek(0)
+ data = np.loadtxt(c, usecols=(1,), converters={0: lambda s: int(s, 16)})
+ assert_array_equal(data, [21, 42])
+
+ c.seek(0)
+ data = np.loadtxt(c, usecols=(1,), converters={1: lambda s: int(s, 16)})
+ assert_array_equal(data, [33, 66])
+
class Testfromregex(TestCase):
def test_record(self):
c = StringIO.StringIO()