From 676081b87aebe9d20d994fd8812bba48c56121e3 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 12 Jan 2010 17:35:06 +0100 Subject: [PATCH] remove the PickleChannel dependency for looponfail --HG-- branch : trunk --- py/impl/test/config.py | 5 +++-- py/impl/test/looponfail/remote.py | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/py/impl/test/config.py b/py/impl/test/config.py index 641e01384..731c0ac18 100644 --- a/py/impl/test/config.py +++ b/py/impl/test/config.py @@ -114,7 +114,7 @@ class Config(object): for path in self.args: path = py.path.local(path) l.append(path.relto(self.topdir)) - return l, self.option + return l, vars(self.option) def __setstate__(self, repr): # we have to set py.test.config because loading @@ -126,7 +126,8 @@ class Config(object): self._rootcol = RootCollector(config=self) args, cmdlineopts = repr args = [str(self.topdir.join(x)) for x in args] - self.option = cmdlineopts + self.option = CmdOptions() + self.option.__dict__.update(cmdlineopts) self._preparse(args) self._setargs(args) diff --git a/py/impl/test/looponfail/remote.py b/py/impl/test/looponfail/remote.py index da47d19d8..473b008fe 100644 --- a/py/impl/test/looponfail/remote.py +++ b/py/impl/test/looponfail/remote.py @@ -11,7 +11,6 @@ import py import sys import execnet from py.impl.test.session import Session -from py.impl.test.dist.mypickle import PickleChannel from py.impl.test.looponfail import util class LooponfailingSession(Session): @@ -63,19 +62,22 @@ class RemoteControl(object): raise ValueError("already have gateway %r" % self.gateway) self.trace("setting up slave session") self.gateway = self.initgateway() - channel = self.gateway.remote_exec(""" + self.channel = channel = self.gateway.remote_exec(""" import os - from py.impl.test.dist.mypickle import PickleChannel - from py.impl.test.looponfail.remote import slave_runsession + import py chdir = channel.receive() outchannel = channel.gateway.newchannel() channel.send(outchannel) - channel = PickleChannel(channel) os.chdir(chdir) # unpickling config uses cwd as topdir - config, fullwidth, hasmarkup = channel.receive() + config_state = channel.receive() + fullwidth, hasmarkup = channel.receive() + py.test.config.__setstate__(config_state) + import sys sys.stdout = sys.stderr = outchannel.makefile('w') - slave_runsession(channel, config, fullwidth, hasmarkup) + + from py.impl.test.looponfail.remote import slave_runsession + slave_runsession(channel, py.test.config, fullwidth, hasmarkup) """) channel.send(str(self.config.topdir)) remote_outchannel = channel.receive() @@ -83,8 +85,8 @@ class RemoteControl(object): out._file.write(s) out._file.flush() remote_outchannel.setcallback(write) - channel = self.channel = PickleChannel(channel) - channel.send((self.config, out.fullwidth, out.hasmarkup)) + channel.send(self.config.__getstate__()) + channel.send((out.fullwidth, out.hasmarkup)) self.trace("set up of slave session complete") def ensure_teardown(self):