Author: Vincent Legoll <vincent.leg...@idgrilles.fr>
Branch: fix-1674
Changeset: r81478:1ce0385fef52
Date: 2015-12-22 19:38 +0100
http://bitbucket.org/pypy/pypy/changeset/1ce0385fef52/

Log:    Fix test: use .all()

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
@@ -3252,7 +3252,7 @@
         assert array(x, copy=True) is not x
 
     def test_issue_1674(self):
-        # Mask indexing does not work with a second dimension
+        # Mask indexing does not work with a second index
         from numpy import arange, array
         data = arange(15).reshape(3, 5) * 1.0
         assert (data == array([[  0.,   1.,   2.,   3.,   4.],
@@ -3260,9 +3260,11 @@
                                [ 10.,  11.,  12.,  13.,  14.]])).all()
         m = data[:, 0] % 2 == 0
         assert (m == array([ True, False,  True], dtype=bool)).all()
-        assert data[m, 0] == array([  0.,  10.])
+        assert (data[m] == array([[  0.,   1.,   2.,   3.,   4.],
+                                  [ 10.,  11.,  12.,  13.,  14.]])).all()
+        assert (data[m, 0] == array([  0.,  10.])).all()
         # Assume False for missing elements of the bool index array
-        assert data[0, m] == array([ 0.,  2.])
+        assert (data[0, m] == array([ 0.,  2.])).all()
 
     def test_dual_indexing_selecting(self):
         from numpy import arange, array
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to