Author: Romain Guillebert <[email protected]>
Branch: numpy-subarrays
Changeset: r63985:2ed9933ad5ce
Date: 2013-05-11 16:55 +0200
http://bitbucket.org/pypy/pypy/changeset/2ed9933ad5ce/
Log: Add a test for subarrays
diff --git a/pypy/module/micronumpy/test/test_dtypes.py
b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -723,7 +723,7 @@
x = int8(42).ravel()
assert x.dtype == int8
assert (x == array(42)).all()
-
+
class AppTestStrUnicodeDtypes(BaseNumpyAppTest):
@@ -790,6 +790,15 @@
d = dtype({'names': ['a', 'b', 'c'],
})
+ def test_create_subarrays(self):
+ from numpypy import dtype
+ d = dtype([("x", "float", (2,)), ("y", "int", (2,))])
+ assert d.itemsize == 32
+ keys = d.fields.keys()
+ assert "x" in keys
+ assert "y" in keys
+ assert d["x"].shape == (2,)
+
class AppTestNotDirect(BaseNumpyAppTest):
def setup_class(cls):
BaseNumpyAppTest.setup_class.im_func(cls)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit