Author: Romain Guillebert <[email protected]>
Branch: numpy-subarrays
Changeset: r64039:41899867e728
Date: 2013-05-13 19:50 +0200
http://bitbucket.org/pypy/pypy/changeset/41899867e728/
Log: Add a numarray test for subarrays.
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
@@ -2699,6 +2699,15 @@
assert a[0]['y'] == 2
assert a[1]['y'] == 1
+ def test_subarrays(self):
+ from numpypy import dtype, array
+
+ d = dtype([("x", "int", 3), ("y", "float", 5)])
+ a = array([([1, 2, 3], [0.5, 1.5, 2.5, 3.5, 4.5])], dtype=d)
+
+ assert a[0]["x"] == [1, 2, 3].all()
+ assert a[1]["y"] == [0.5, 1.5, 2.5, 3.5, 4.5].all()
+
class AppTestPyPy(BaseNumpyAppTest):
def setup_class(cls):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit