Commits

Amaury Forgeot d'Arc committed 533ae27

Fix tests in _multiprocessing

Comments (0)

Files changed (2)

pypy/module/_multiprocessing/interp_connection.py

             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)
             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)
             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)

pypy/module/_multiprocessing/test/test_connection.py

 
 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)
         assert obj == obj2
 
     def test_poll(self):
-        py3k_skip('fixme later')
         rhandle, whandle = self.make_pair()
 
         assert rhandle.poll() == False
         raises(IOError, whandle.poll)
 
     def test_read_into(self):
-        py3k_skip('fixme later')
         import array, multiprocessing
         rhandle, whandle = self.make_pair()
 
 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([])
 
         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')