diff --git a/CHANGELOG b/CHANGELOG index ac74bc9..d12c29b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ ------- - fix readme display on pypi +- fix #22: xdist now works if the internal tmpdir plugin is disabled. 1.13.1 diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 70052c3..bec87f1 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -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: def test_load_single(self, testdir): f = testdir.makepyfile(""" diff --git a/xdist/slavemanage.py b/xdist/slavemanage.py index b50dab5..7632137 100644 --- a/xdist/slavemanage.py +++ b/xdist/slavemanage.py @@ -228,8 +228,9 @@ class SlaveController(object): option_dict = vars(self.config.option) if spec.popen: name = "popen-%s" % self.gateway.id - basetemp = self.config._tmpdirhandler.getbasetemp() - option_dict['basetemp'] = str(basetemp.join(name)) + if hasattr(self.config, '_tmpdirhandler'): + basetemp = self.config._tmpdirhandler.getbasetemp() + option_dict['basetemp'] = str(basetemp.join(name)) self.config.hook.pytest_configure_node(node=self) self.channel = self.gateway.remote_exec(xdist.remote) self.channel.send((self.slaveinput, args, option_dict))