Skip to content

Commit f8ea4a2

Browse files
committed
fix again
1 parent 68bf76d commit f8ea4a2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/xdist/workermanage.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,21 @@ def setup_nodes(
9797
self.trace("setting up nodes")
9898
with ThreadPoolExecutor(max_workers=len(self.specs)) as executor:
9999
futs = [
100-
executor.submit(self.setup_node, idx, spec, putevent)
100+
executor.submit(self.setup_node, spec, putevent, idx)
101101
for idx, spec in enumerate(self.specs)
102102
]
103103
return [f.result() for f in futs]
104104

105105
def setup_node(
106106
self,
107-
idx: int,
108107
spec: execnet.XSpec,
109108
putevent: Callable[[tuple[str, dict[str, Any]]], None],
109+
idx: int = None,
110110
) -> WorkerController:
111111
if getattr(spec, "execmodel", None) != "main_thread_only":
112112
spec = execnet.XSpec(f"execmodel=main_thread_only//{spec}")
113-
spec = execnet.XSpec(f"{spec}//id=gw{idx}")
113+
if idx is not None:
114+
spec = execnet.XSpec(f"{spec}//id=gw{idx}")
114115
gw = self.group.makegateway(spec)
115116
self.config.hook.pytest_xdist_newgateway(gateway=gw)
116117
self.rsync_roots(gw)

0 commit comments

Comments
 (0)