diff --git a/py/impl/test/looponfail/remote.py b/py/impl/test/looponfail/remote.py index 7df75b661..6fd21e8c5 100644 --- a/py/impl/test/looponfail/remote.py +++ b/py/impl/test/looponfail/remote.py @@ -62,22 +62,22 @@ class RemoteControl(object): if hasattr(self, 'gateway'): raise ValueError("already have gateway %r" % self.gateway) self.trace("setting up slave session") - old = self.config.topdir.chdir() - try: - self.gateway = self.initgateway() - finally: - old.chdir() - channel = self.gateway.remote_exec(source=""" + self.gateway = self.initgateway() + channel = self.gateway.remote_exec(""" + import os from py.impl.test.dist.mypickle import PickleChannel from py.impl.test.looponfail.remote import slave_runsession + 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() import sys sys.stdout = sys.stderr = outchannel.makefile('w') slave_runsession(channel, config, fullwidth, hasmarkup) """) + channel.send(str(self.config.topdir)) remote_outchannel = channel.receive() def write(s): out._file.write(s) diff --git a/testing/pytest/test_config.py b/testing/pytest/test_config.py index e1d26aabb..e98f2e580 100644 --- a/testing/pytest/test_config.py +++ b/testing/pytest/test_config.py @@ -16,7 +16,6 @@ class TestConfigCmdlineParsing: help='t value'), ) """) - testdir.chdir() config = testdir.reparseconfig(['-G', '17']) assert config.option.gdest == 17 @@ -46,19 +45,6 @@ class TestConfigCmdlineParsing: config = testdir.parseconfig() assert config.option.verbose - def test_config_cmdline_options_only_lowercase(self, testdir): - testdir.makepyfile(conftest=""" - import py - Option = py.test.config.Option - options = py.test.config.addoptions("testing group", - Option('-g', '--glong', action="store", default=42, - type="int", dest="gdest", help="g value."), - ) - """) - py.test.raises(ValueError, """ - testdir.reparseconfig(['-g', '17']) - """) - def test_parsing_again_fails(self, testdir): config = testdir.reparseconfig([testdir.tmpdir]) py.test.raises(AssertionError, "config.parse([])")