Merge pull request #27 from nicoddemus/fix-22-tmpdir

xdist now works if the internal tmpdir plugin is disabled
This commit is contained in:
Ronny Pfannschmidt
2015-12-05 20:42:41 +01:00
3 changed files with 16 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
------- -------
- fix readme display on pypi - fix readme display on pypi
- fix #22: xdist now works if the internal tmpdir plugin is disabled.
1.13.1 1.13.1

View File

@@ -522,6 +522,18 @@ def test_issue_594_random_parametrize(testdir):
]) ])
def test_tmpdir_disabled(testdir):
"""Test xdist doesn't break if internal tmpdir plugin is disabled (#22).
"""
p1 = testdir.makepyfile("""
def test_ok():
pass
""")
result = testdir.runpytest(p1, "-n1", '-p', 'no:tmpdir')
assert result.ret == 0
result.stdout.fnmatch_lines("*1 passed*")
class TestNodeFailure: class TestNodeFailure:
def test_load_single(self, testdir): def test_load_single(self, testdir):
f = testdir.makepyfile(""" f = testdir.makepyfile("""

View File

@@ -228,8 +228,9 @@ class SlaveController(object):
option_dict = vars(self.config.option) option_dict = vars(self.config.option)
if spec.popen: if spec.popen:
name = "popen-%s" % self.gateway.id name = "popen-%s" % self.gateway.id
basetemp = self.config._tmpdirhandler.getbasetemp() if hasattr(self.config, '_tmpdirhandler'):
option_dict['basetemp'] = str(basetemp.join(name)) basetemp = self.config._tmpdirhandler.getbasetemp()
option_dict['basetemp'] = str(basetemp.join(name))
self.config.hook.pytest_configure_node(node=self) self.config.hook.pytest_configure_node(node=self)
self.channel = self.gateway.remote_exec(xdist.remote) self.channel = self.gateway.remote_exec(xdist.remote)
self.channel.send((self.slaveinput, args, option_dict)) self.channel.send((self.slaveinput, args, option_dict))