Author: Matti Picus <[email protected]>
Branch: memoryview-attributes
Changeset: r86188:56370389b4ea
Date: 2016-08-14 21:17 +0300
http://bitbucket.org/pypy/pypy/changeset/56370389b4ea/

Log:    test showing current memoryview shortcomings

diff --git a/pypy/module/micronumpy/test/test_ndarray.py 
b/pypy/module/micronumpy/test/test_ndarray.py
--- a/pypy/module/micronumpy/test/test_ndarray.py
+++ b/pypy/module/micronumpy/test/test_ndarray.py
@@ -3633,6 +3633,14 @@
         #assert a.base is data.__buffer__
         assert a.tostring() == 'abc'
 
+    def test_memoryview(self):
+        import numpy as np
+        x = np.array([1, 2, 3, 4, 5], dtype='i')
+        y = memoryview('abc')
+        assert y.format == 'B'
+        y = memoryview(x)
+        assert y.format == 'i'
+
     def test_fromstring(self):
         import sys
         from numpy import fromstring, dtype
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to