[pypy-commit] pypy matrixmath: add test for numpy.flatiter, more tests for transpose

mattip noreply at buildbot.pypy.org
Sun Nov 27 22:08:02 CET 2011


Author: mattip
Branch: matrixmath
Changeset: r49865:bb947060bebf
Date: 2011-11-27 22:51 +0200
http://bitbucket.org/pypy/pypy/changeset/bb947060bebf/

Log:	add test for numpy.flatiter, more tests for transpose

diff --git a/pypy/module/micronumpy/test/test_numarray.py b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -951,6 +951,12 @@
         assert(b[0, :, 0] == [0, 3]).all()
         b[:, 0, 0] = 1000
         assert(a[0, 0, :] == [1000, 1000, 1000]).all()
+        a = array(range(5))
+        b = a.T
+        assert(b == range(5)).all()
+        a=numpypy.array((range(10),range(20,30)))
+        b=a.T
+        assert(b[:,0] == a[0,:]).all()
 
     def test_flatiter(self):
         from numpypy import array
@@ -961,6 +967,7 @@
         assert f_iter.next() == 40
         assert f_iter.next() == 60
         raises(StopIteration, "f_iter.next()")
+        raises(TypeError, "numpy.flatiter()")
 
 
 class AppTestSupport(object):


More information about the pypy-commit mailing list