Do not change PYTHONPATH or sys.path on local workers

Fix #376
This commit is contained in:
Bruno Oliveira
2019-01-08 09:16:38 -02:00
parent ca94bda1b7
commit f8d51aab57
3 changed files with 17 additions and 9 deletions

View File

@@ -245,7 +245,9 @@ class WorkerController(object):
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.workerinput, args, option_dict))
# change sys.path only for remote workers
change_sys_path = not self.gateway.spec.popen
self.channel.send((self.workerinput, args, option_dict, change_sys_path))
if self.putevent:
self.channel.setcallback(self.process_from_remote, endmarker=self.ENDMARK)