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_newchannel(self): channel = self.gw.remote_exec(""" from py.__.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) newchannel = channel.receive() newchannel.send(42) """) channel = PickleChannel(channel) newchannel = self.gw.newchannel() channel.send(newchannel) channel.waitclose() res = newchannel.receive() assert res == 42
def test_popen_with_newchannel(self): channel = self.gw.remote_exec(""" from py.__.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) newchannel = channel.receive() newchannel.send(42) """) channel = PickleChannel(channel) newchannel = self.gw.newchannel() channel.send(newchannel) channel.waitclose() res = newchannel.receive() assert res == 42
def test_config__setstate__wired_correctly_in_childprocess(testdir): from py.__.test.dist.mypickle import PickleChannel gw = py.execnet.PopenGateway() channel = gw.remote_exec(""" import py from py.__.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) config = channel.receive() assert py.test.config.pluginmanager.comregistry == py._com.comregistry, "comregistry wrong" """) channel = PickleChannel(channel) config = testdir.parseconfig() channel.send(config) channel.waitclose() # this will potentially raise gw.exit()
def test_config__setstate__wired_correctly_in_childprocess(testdir): from py.__.test.dist.mypickle import PickleChannel gw = py.execnet.PopenGateway() channel = gw.remote_exec(""" import py from py.__.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) config = channel.receive() assert py.test.config.pluginmanager.comregistry == py._com.comregistry, "comregistry wrong" """) channel = PickleChannel(channel) config = testdir.parseconfig() channel.send(config) channel.waitclose() # this will potentially raise gw.exit()