summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2015-01-23 16:06:27 -0700
committerCharles Harris <charlesr.harris@gmail.com>2015-01-23 16:06:27 -0700
commit4b1aab31cc66d4a5abd3d2d6b40e461cadd79d2a (patch)
tree63d09cd6b2c4b6476d144437637dd44d886d83bd
parent1b88f08b4f27e26adc7a1200a51974eb5bf719e0 (diff)
downloadnumpy-4b1aab31cc66d4a5abd3d2d6b40e461cadd79d2a.tar.gz
TST: Fix bug in test_dtype_with_converters_and_usecols.
The case_sensitive argument to np.recfromcsv has a default value of 'lower'. That value was not previously correctly passed on, but is now, so the previous expected values in this test were incorrectly upper cased.
-rw-r--r--numpy/lib/tests/test_io.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index 1dcffcd64..9c8a97c9d 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -1107,13 +1107,13 @@ M 33 21.99
def test_dtype_with_converters_and_usecols(self):
dstr = "1,5,-1,1:1\n2,8,-1,1:n\n3,3,-2,m:n\n"
dmap = {'1:1':0, '1:n':1, 'm:1':2, 'm:n':3}
- dtyp = [('E1','i4'),('E2','i4'),('E3','i2'),('N', 'i1')]
+ dtyp = [('e1','i4'),('e2','i4'),('e3','i2'),('n', 'i1')]
conv = {0: int, 1: int, 2: int, 3: lambda r: dmap[r.decode()]}
test = np.recfromcsv(TextIO(dstr,), dtype=dtyp, delimiter=',',
names=None, converters=conv)
control = np.rec.array([[1,5,-1,0], [2,8,-1,1], [3,3,-2,3]], dtype=dtyp)
assert_equal(test, control)
- dtyp = [('E1','i4'),('E2','i4'),('N', 'i1')]
+ dtyp = [('e1','i4'),('e2','i4'),('n', 'i1')]
test = np.recfromcsv(TextIO(dstr,), dtype=dtyp, delimiter=',',
usecols=(0,1,3), names=None, converters=conv)
control = np.rec.array([[1,5,0], [2,8,1], [3,3,3]], dtype=dtyp)