Skip to content

Commit 5ddef63

Browse files
committed
xdist now works if the internal tmpdir plugin is disabled
Fix #22
1 parent afd3f2b commit 5ddef63

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-------
33

44
- fix readme display on pypi
5+
- fix #22: xdist now works if the internal tmpdir plugin is disabled.
56

67

78
1.13.1

testing/acceptance_test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,18 @@ def test_foo(x):
522522
])
523523

524524

525+
def test_tmpdir_disabled(testdir):
526+
"""Test xdist doesn't break if internal tmpdir plugin is disabled (#22).
527+
"""
528+
p1 = testdir.makepyfile("""
529+
def test_ok():
530+
pass
531+
""")
532+
result = testdir.runpytest(p1, "-n1", '-p', 'no:tmpdir')
533+
assert result.ret == 0
534+
result.stdout.fnmatch_lines("*1 passed*")
535+
536+
525537
class TestNodeFailure:
526538
def test_load_single(self, testdir):
527539
f = testdir.makepyfile("""

xdist/slavemanage.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,9 @@ def setup(self):
228228
option_dict = vars(self.config.option)
229229
if spec.popen:
230230
name = "popen-%s" % self.gateway.id
231-
basetemp = self.config._tmpdirhandler.getbasetemp()
232-
option_dict['basetemp'] = str(basetemp.join(name))
231+
if hasattr(self.config, '_tmpdirhandler'):
232+
basetemp = self.config._tmpdirhandler.getbasetemp()
233+
option_dict['basetemp'] = str(basetemp.join(name))
233234
self.config.hook.pytest_configure_node(node=self)
234235
self.channel = self.gateway.remote_exec(xdist.remote)
235236
self.channel.send((self.slaveinput, args, option_dict))

0 commit comments

Comments
 (0)