def test_popen_with_various_methods(self): channel = self.gw.remote_exec(""" from py.__.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) channel.receive() """) channel = PickleChannel(channel) assert not channel.isclosed() assert not channel._getremoteerror() channel.send(2) channel.waitclose(timeout=2)
def test_popen_with_various_methods(self): channel = self.gw.remote_exec(""" from py.__.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) channel.receive() """) channel = PickleChannel(channel) assert not channel.isclosed() assert not channel._getremoteerror() channel.send(2) channel.waitclose(timeout=2)
def test_popen_with_callback_with_endmarker_and_unpickling_error(self): channel = self.gw.remote_exec(""" from py.__.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) from py.__.test.dist.testing.test_mypickle import A a1 = A() channel.send(a1) channel.send(a1) """) channel = PickleChannel(channel) queue = py.std.Queue.Queue() a = channel.receive() channel._ipickle._unpicklememo.clear() channel.setcallback(queue.put, endmarker=-1) next = queue.get(timeout=TESTTIMEOUT) assert next == -1 error = channel._getremoteerror() assert isinstance(error, UnpickleError)
def test_popen_with_callback_with_endmarker_and_unpickling_error(self): channel = self.gw.remote_exec(""" from py.__.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) from py.__.test.dist.testing.test_mypickle import A a1 = A() channel.send(a1) channel.send(a1) """) channel = PickleChannel(channel) queue = py.std.Queue.Queue() a = channel.receive() channel._ipickle._unpicklememo.clear() channel.setcallback(queue.put, endmarker=-1) next = queue.get(timeout=TESTTIMEOUT) assert next == -1 error = channel._getremoteerror() assert isinstance(error, UnpickleError)