Author: Vincent Legoll <vincent.leg...@idgrilles.fr>
Branch: fix-1674
Changeset: r81465:ed761ed18fa8
Date: 2015-12-19 11:33 +0100
http://bitbucket.org/pypy/pypy/changeset/ed761ed18fa8/

Log:    Add a failing test for issue #1674

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
@@ -3251,6 +3251,16 @@
         assert array(x, copy=False) is x
         assert array(x, copy=True) is not x
 
+    def test_issue_1674(self):
+        import numpy as np
+        data = np.arange(15).reshape(3, 5) * 1.0
+        # array([[  0.,   1.,   2.,   3.,   4.],
+        #        [  5.,   6.,   7.,   8.,   9.],
+        #        [ 10.,  11.,  12.,  13.,  14.]])
+        m = data[:, 0] % 2 == 0
+        # array([ True, False,  True], dtype=bool)
+        assert data[m, 0] == array([  0.,  10.])
+
     def test_ravel(self):
         from numpy import arange
         assert (arange(3).ravel() == arange(3)).all()
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to