Author: Ronan Lamy <[email protected]>
Branch: py3k
Changeset: r83528:a252fd879fe7
Date: 2016-04-05 19:14 +0100
http://bitbucket.org/pypy/pypy/changeset/a252fd879fe7/
Log: port test to py3
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
@@ -54,16 +54,16 @@
import sys
module = self.import_module(name='array')
arr = module.array('i', [1,2,3,4])
- buf = buffer(arr)
+ buf = memoryview(arr)
exc = raises(TypeError, "buf[1] = '1'")
- assert str(exc.value) == "buffer is read-only"
+ assert str(exc.value) == "cannot modify read-only memory"
if sys.byteorder == 'big':
- assert str(buf) == (b'\0\0\0\x01'
+ assert bytes(buf) == (b'\0\0\0\x01'
b'\0\0\0\x02'
b'\0\0\0\x03'
b'\0\0\0\x04')
else:
- assert str(buf) == (b'\x01\0\0\0'
+ assert bytes(buf) == (b'\x01\0\0\0'
b'\x02\0\0\0'
b'\x03\0\0\0'
b'\x04\0\0\0')
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit