[pypy-commit] pypy numppy-flatitter: a few missing tests

fijal noreply at buildbot.pypy.org
Fri Jan 27 20:01:11 CET 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numppy-flatitter
Changeset: r51855:13420231bfda
Date: 2012-01-27 20:55 +0200
http://bitbucket.org/pypy/pypy/changeset/13420231bfda/

Log:	a few missing tests

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
@@ -1349,7 +1349,7 @@
         assert(b[:, 0] == a[0, :]).all()
 
     def test_flatiter(self):
-        from _numpypy import array, flatiter
+        from _numpypy import array, flatiter, arange
         a = array([[10, 30], [40, 60]])
         f_iter = a.flat
         assert f_iter.next() == 10
@@ -1362,6 +1362,9 @@
         for k in a.flat:
             s += k
         assert s == 140
+        a = arange(10).reshape(5, 2)
+        raises(IndexError, 'a.flat[(1, 2)]')
+        assert a.flat.base is a
 
     def test_flatiter_array_conv(self):
         from _numpypy import array, dot


More information about the pypy-commit mailing list