diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-01-18 01:21:03 -0800 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-01-18 01:41:24 -0800 |
commit | 47c4f32b9a51f549041cd71ddaad3055c7752d5e (patch) | |
tree | ed831e62fa7a70c05a366aaa15c28e0d9878821f /numpy/core/tests | |
parent | 669e87af8f2fdda9f17ad221a0e8cc1fd91c5a0e (diff) | |
download | python-numpy-47c4f32b9a51f549041cd71ddaad3055c7752d5e.tar.gz python-numpy-47c4f32b9a51f549041cd71ddaad3055c7752d5e.tar.bz2 python-numpy-47c4f32b9a51f549041cd71ddaad3055c7752d5e.zip |
MAINT: Use ValueError for duplicate field names in lookup
KeyError suggests the field name does not exist, which is inaccurate.
Diffstat (limited to 'numpy/core/tests')
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index e54d67a0d..1113b6476 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -1157,9 +1157,11 @@ class TestStructured(object): def test_multiindex_titles(self): a = np.zeros(4, dtype=[(('a', 'b'), 'i'), ('c', 'i'), ('d', 'i')]) assert_raises(KeyError, lambda : a[['a','c']]) - assert_raises(KeyError, lambda : a[['b','b']]) + assert_raises(KeyError, lambda : a[['a','a']]) + assert_raises(ValueError, lambda : a[['b','b']]) # field exists, but repeated a[['b','c']] # no exception + class TestBool(object): def test_test_interning(self): a0 = np.bool_(0) |