Author: Ronan Lamy <[email protected]>
Branch: py3.5
Changeset: r90060:9f7edc16f16c
Date: 2017-02-11 20:10 +0000
http://bitbucket.org/pypy/pypy/changeset/9f7edc16f16c/
Log: Test 0d view on C-created buffer
diff --git a/pypy/module/cpyext/test/test_arraymodule.py
b/pypy/module/cpyext/test/test_arraymodule.py
--- a/pypy/module/cpyext/test/test_arraymodule.py
+++ b/pypy/module/cpyext/test/test_arraymodule.py
@@ -69,6 +69,14 @@
b'\x03\0\0\0'
b'\x04\0\0\0')
+ def test_0d_view(self):
+ module = self.import_module(name='array')
+ arr = module.array('B', b'\0\0\0\x01')
+ buf = memoryview(arr).cast('i', shape=())
+ assert bytes(buf) == b'\0\0\0\x01'
+ assert buf.shape == ()
+ assert buf.strides == ()
+
def test_binop_mul_impl(self):
# check that rmul is called
module = self.import_module(name='array')
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit