summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2013-04-12 15:14:02 +0200
committerSebastian Berg <sebastian@sipsolutions.net>2013-04-12 15:18:57 +0200
commit1f8443764550ec4626469f6afd8e78de10e62b2e (patch)
tree3c4455658661b04f1db360b0067f895ef45ed384 /numpy
parent9466880fc907ddf864aab47aff0642a4cb57aaf6 (diff)
downloadnumpy-1f8443764550ec4626469f6afd8e78de10e62b2e.tar.gz
TST: Clarify empty fancy index test
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_indexing.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/core/tests/test_indexing.py b/numpy/core/tests/test_indexing.py
index 7b7db02d0..6906dcf6b 100644
--- a/numpy/core/tests/test_indexing.py
+++ b/numpy/core/tests/test_indexing.py
@@ -28,16 +28,17 @@ class TestIndexing(TestCase):
assert_equal(a[()], a)
assert_(a[()].base is a)
- def test_empty_list_index(self):
+ def test_empty_fancy_index(self):
# Empty list index creates an empty array
# with the same dtype (but with weird shape)
a = np.array([1, 2, 3])
assert_equal(a[[]], [])
assert_equal(a[[]].dtype, a.dtype)
- def test_empty_array_index(self):
- # Empty array index is illegal
- a = np.array([1, 2, 3])
+ b = np.array([], dtype=np.intp)
+ assert_equal(a[[]], [])
+ assert_equal(a[[]].dtype, a.dtype)
+
b = np.array([])
assert_raises(IndexError, a.__getitem__, b)