fix again
This commit is contained in:
@@ -97,19 +97,20 @@ class NodeManager:
|
||||
self.trace("setting up nodes")
|
||||
with ThreadPoolExecutor(max_workers=len(self.specs)) as executor:
|
||||
futs = [
|
||||
executor.submit(self.setup_node, idx, spec, putevent)
|
||||
executor.submit(self.setup_node, spec, putevent, idx)
|
||||
for idx, spec in enumerate(self.specs)
|
||||
]
|
||||
return [f.result() for f in futs]
|
||||
|
||||
def setup_node(
|
||||
self,
|
||||
idx: int,
|
||||
spec: execnet.XSpec,
|
||||
putevent: Callable[[tuple[str, dict[str, Any]]], None],
|
||||
idx: int = None,
|
||||
) -> WorkerController:
|
||||
if getattr(spec, "execmodel", None) != "main_thread_only":
|
||||
spec = execnet.XSpec(f"execmodel=main_thread_only//{spec}")
|
||||
if idx is not None:
|
||||
spec = execnet.XSpec(f"{spec}//id=gw{idx}")
|
||||
gw = self.group.makegateway(spec)
|
||||
self.config.hook.pytest_xdist_newgateway(gateway=gw)
|
||||
|
||||
Reference in New Issue
Block a user