[pypy-commit] pypy numpypy-nditer: improve a test, enable buffered test

mattip noreply at buildbot.pypy.org
Mon Apr 14 14:58:22 CEST 2014


Author: Matti Picus <matti.picus at gmail.com>
Branch: numpypy-nditer
Changeset: r70629:ba9de3154a7b
Date: 2014-04-14 14:59 +0300
http://bitbucket.org/pypy/pypy/changeset/ba9de3154a7b/

Log:	improve a test, enable buffered test

diff --git a/pypy/module/micronumpy/concrete.py b/pypy/module/micronumpy/concrete.py
--- a/pypy/module/micronumpy/concrete.py
+++ b/pypy/module/micronumpy/concrete.py
@@ -464,7 +464,7 @@
 class NonWritableSlice(SliceArray):
     def descr_setitem(self, space, orig_array, w_index, w_value):
         raise OperationError(space.w_ValueError, space.wrap(
-            "Assignment destination is read-only"))
+            "assignment destination is read-only"))
 
 class VoidBoxStorage(BaseConcreteArray):
     def __init__(self, size, dtype):
diff --git a/pypy/module/micronumpy/test/test_nditer.py b/pypy/module/micronumpy/test/test_nditer.py
--- a/pypy/module/micronumpy/test/test_nditer.py
+++ b/pypy/module/micronumpy/test/test_nditer.py
@@ -52,13 +52,9 @@
             n += 1
         assert n == 12
         assert (array(r) == [[ 0, 12], [ 4, 16], [ 8, 20], [ 1, 13], [ 5, 17], [ 9, 21], [ 2, 14], [ 6, 18], [10, 22], [ 3, 15], [ 7, 19], [11, 23]]).all()
-        e = None
-        try:
-            r[0][0] = 0
-        except ValueError, ex:
-            e = ex
-        assert e
-
+        e = raises(ValueError, 'r[0][0] = 0')
+        assert str(e.value) == 'assignment destination is read-only'
+           
     def test_index(self):
         from numpy import arange, nditer
         a = arange(6).reshape(2,3)
@@ -118,12 +114,8 @@
 
     def test_buffered(self):
         from numpy import arange, nditer, array
-        import sys
         a = arange(6).reshape(2,3)
         r = []
-        if '__pypy__' in sys.builtin_module_names:
-            raises(NotImplementedError, "nditer(a, flags=['external_loop', 'buffered'], order='F')")
-            skip('nditer buffered flag not implmented')
         for x in nditer(a, flags=['external_loop', 'buffered'], order='F'):
             r.append(x)
         array_r = array(r)


More information about the pypy-commit mailing list