[pypy-commit] pypy py3.3: Adapt this test to the new memoryview API.
mjacob
noreply at buildbot.pypy.org
Fri Feb 27 17:32:36 CET 2015
Author: Manuel Jacob <me at manueljacob.de>
Branch: py3.3
Changeset: r76175:64f039c98dcf
Date: 2015-02-27 16:29 +0100
http://bitbucket.org/pypy/pypy/changeset/64f039c98dcf/
Log: Adapt this test to the new memoryview API.
diff --git a/pypy/module/__pypy__/test/test_bytebuffer.py b/pypy/module/__pypy__/test/test_bytebuffer.py
--- a/pypy/module/__pypy__/test/test_bytebuffer.py
+++ b/pypy/module/__pypy__/test/test_bytebuffer.py
@@ -5,15 +5,13 @@
from __pypy__ import bytebuffer
b = bytebuffer(12)
assert len(b) == 12
- b[3] = b'!'
- b[5] = b'?'
+ b[3] = ord(b'!')
+ b[5] = ord(b'?')
assert b[2:7] == b'\x00!\x00?\x00'
b[9:] = b'+-*'
- assert b[-1] == b'*'
- assert b[-2] == b'-'
- assert b[-3] == b'+'
- exc = raises(ValueError, "b[3] = b'abc'")
- assert str(exc.value) == "cannot modify size of memoryview object"
+ assert b[-1] == ord(b'*')
+ assert b[-2] == ord(b'-')
+ assert b[-3] == ord(b'+')
exc = raises(ValueError, "b[3:5] = b'abc'")
assert str(exc.value) == "cannot modify size of memoryview object"
raises(NotImplementedError, "b[3:7:2] = b'abc'")
More information about the pypy-commit
mailing list