15
15
import pytest
16
16
from execnet .gateway_base import dumps , DumpError
17
17
18
+ from _pytest .config import _prepareconfig , Config
19
+
18
20
19
21
class WorkerInteractor (object ):
20
22
def __init__ (self , config , channel ):
@@ -211,18 +213,18 @@ def getinfodict():
211
213
212
214
213
215
def remote_initconfig (option_dict , args ):
214
- from _pytest .config import Config
215
-
216
216
option_dict ["plugins" ].append ("no:terminal" )
217
- config = Config .fromdictargs (option_dict , args )
217
+ return Config .fromdictargs (option_dict , args )
218
+
219
+
220
+ def setup_config (config , basetemp ):
218
221
config .option .looponfail = False
219
222
config .option .usepdb = False
220
223
config .option .dist = "no"
221
224
config .option .distload = False
222
225
config .option .numprocesses = None
223
226
config .option .maxprocesses = None
224
- config .args = args
225
- return config
227
+ config .option .basetemp = basetemp
226
228
227
229
228
230
if __name__ == "__channelexec__" :
@@ -239,7 +241,12 @@ def remote_initconfig(option_dict, args):
239
241
os .environ ["PYTEST_XDIST_WORKER" ] = workerinput ["workerid" ]
240
242
os .environ ["PYTEST_XDIST_WORKER_COUNT" ] = str (workerinput ["workercount" ])
241
243
242
- config = remote_initconfig (option_dict , args )
244
+ if hasattr (Config , "InvocationParams" ):
245
+ config = _prepareconfig (args , None )
246
+ else :
247
+ config = remote_initconfig (option_dict , args )
248
+
249
+ setup_config (config , option_dict .get ("basetemp" ))
243
250
config ._parser .prog = os .path .basename (workerinput ["mainargv" ][0 ])
244
251
config .workerinput = workerinput
245
252
config .workeroutput = {}
0 commit comments