Author: Vincent Legoll <vincent.leg...@idgrilles.fr> Branch: fix-1674 Changeset: r81479:5cc3ef540d5d Date: 2015-12-23 15:29 +0100 http://bitbucket.org/pypy/pypy/changeset/5cc3ef540d5d/
Log: Move array indexing + slice into its own test diff --git a/pypy/module/micronumpy/test/test_ndarray.py b/pypy/module/micronumpy/test/test_ndarray.py --- a/pypy/module/micronumpy/test/test_ndarray.py +++ b/pypy/module/micronumpy/test/test_ndarray.py @@ -3405,8 +3405,7 @@ from numpy import array assert (array([])[[]] == []).all() a = array([[1, 2], [3, 4], [5, 6]]) - assert (a[slice(0, 3), [0, 0]] == [[1, 1], [3, 3], [5, 5]]).all() - assert (a[array([0, 2]), slice(0, 2)] == [[1, 2], [5, 6]]).all() + b = a[array([0, 0])] assert (b == [[1, 2], [1, 2]]).all() assert (a[[[0, 1], [0, 0]]] == array([1, 3])).all() @@ -3414,6 +3413,12 @@ assert (a[array([0, 2]), 1] == [2, 6]).all() assert (a[array([0, 2]), array([1])] == [2, 6]).all() + def test_int_array_index_n_slice(self): + from numpy import array + a = array([[1, 2], [3, 4], [5, 6]]) + assert (a[slice(0, 3), [0, 0]] == [[1, 1], [3, 3], [5, 5]]).all() + assert (a[array([0, 2]), slice(0, 2)] == [[1, 2], [5, 6]]).all() + def test_int_array_index_setitem(self): from numpy import array a = array([[1, 2], [3, 4], [5, 6]]) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit