Author: Ronan Lamy <ronan.l...@gmail.com> Branch: py3.5 Changeset: r89732:321e73239593 Date: 2017-01-24 14:02 +0000 http://bitbucket.org/pypy/pypy/changeset/321e73239593/
Log: fix tests diff --git a/pypy/module/cpyext/test/test_memoryobject.py b/pypy/module/cpyext/test/test_memoryobject.py --- a/pypy/module/cpyext/test/test_memoryobject.py +++ b/pypy/module/cpyext/test/test_memoryobject.py @@ -13,8 +13,8 @@ w_hello = space.newbytes("hello") #assert api.PyObject_CheckBuffer(w_hello) w_view = from_ref(space, api.PyMemoryView_FromObject(w_hello)) - w_char = space.call_method(w_view, '__getitem__', space.wrap(0)) - assert space.eq_w(w_char, space.wrap('h')) + w_byte = space.call_method(w_view, '__getitem__', space.wrap(0)) + assert space.eq_w(w_byte, space.wrap(ord('h'))) w_bytes = space.call_method(w_view, "tobytes") assert space.unwrap(w_bytes) == "hello" @@ -72,7 +72,6 @@ class AppTestBufferProtocol(AppTestCpythonExtensionBase): def test_buffer_protocol_app(self): - import struct module = self.import_module(name='buffer_test') arr = module.PyMyArray(10) y = memoryview(arr) @@ -80,8 +79,7 @@ assert y.shape == (10,) assert len(y) == 10 s = y[3] - assert len(s) == struct.calcsize('i') - assert s == struct.pack('i', 3) + assert s == 3 def test_buffer_protocol_capi(self): foo = self.import_extension('foo', [ _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit