Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r58391:533ae279f477
Date: 2012-10-23 23:48 +0200
http://bitbucket.org/pypy/pypy/changeset/533ae279f477/
Log: Fix tests in _multiprocessing
diff --git a/pypy/module/_multiprocessing/interp_connection.py
b/pypy/module/_multiprocessing/interp_connection.py
--- a/pypy/module/_multiprocessing/interp_connection.py
+++ b/pypy/module/_multiprocessing/interp_connection.py
@@ -102,9 +102,9 @@
space, self.BUFFER_SIZE, maxlength)
try:
if newbuf:
- return space.wrap(rffi.charpsize2str(newbuf, res))
+ return space.wrapbytes(rffi.charpsize2str(newbuf, res))
else:
- return space.wrap(rffi.charpsize2str(self.buffer, res))
+ return space.wrapbytes(rffi.charpsize2str(self.buffer, res))
finally:
if newbuf:
rffi.free_charp(newbuf)
@@ -118,14 +118,14 @@
space, length - offset, PY_SSIZE_T_MAX)
try:
if newbuf:
- raise BufferTooShort(space, space.wrap(
+ raise BufferTooShort(space, space.wrapbytes(
rffi.charpsize2str(newbuf, res)))
rwbuffer.setslice(offset, rffi.charpsize2str(self.buffer, res))
finally:
if newbuf:
rffi.free_charp(newbuf)
- return space.wrap(res)
+ return space.wrapbytes(res)
def send(self, space, w_obj):
self._check_writable(space)
@@ -148,9 +148,9 @@
space, self.BUFFER_SIZE, PY_SSIZE_T_MAX)
try:
if newbuf:
- w_received = space.wrap(rffi.charpsize2str(newbuf, res))
+ w_received = space.wrapbytes(rffi.charpsize2str(newbuf, res))
else:
- w_received = space.wrap(rffi.charpsize2str(self.buffer, res))
+ w_received = space.wrapbytes(rffi.charpsize2str(self.buffer,
res))
finally:
if newbuf:
rffi.free_charp(newbuf)
diff --git a/pypy/module/_multiprocessing/test/test_connection.py
b/pypy/module/_multiprocessing/test/test_connection.py
--- a/pypy/module/_multiprocessing/test/test_connection.py
+++ b/pypy/module/_multiprocessing/test/test_connection.py
@@ -35,11 +35,10 @@
class BaseConnectionTest(object):
def test_connection(self):
- py3k_skip('fixme later')
rhandle, whandle = self.make_pair()
- whandle.send_bytes("abc")
- assert rhandle.recv_bytes(100) == "abc"
+ whandle.send_bytes(b"abc")
+ assert rhandle.recv_bytes(100) == b"abc"
obj = [1, 2.0, "hello"]
whandle.send(obj)
@@ -47,7 +46,6 @@
assert obj == obj2
def test_poll(self):
- py3k_skip('fixme later')
rhandle, whandle = self.make_pair()
assert rhandle.poll() == False
@@ -61,7 +59,6 @@
raises(IOError, whandle.poll)
def test_read_into(self):
- py3k_skip('fixme later')
import array, multiprocessing
rhandle, whandle = self.make_pair()
@@ -96,7 +93,7 @@
class AppTestSocketConnection(BaseConnectionTest):
def setup_class(cls):
space = gettestobjspace(usemodules=('_multiprocessing', 'thread',
'signal',
- 'struct', 'array'))
+ 'struct', 'array', '_socket'))
cls.space = space
cls.w_connections = space.newlist([])
@@ -160,7 +157,6 @@
raises(IOError, _multiprocessing.Connection, -15)
def test_byte_order(self):
- py3k_skip('fixme later')
import socket
if not 'fromfd' in dir(socket):
skip('No fromfd in socket')
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit