MCPcopy
hub / github.com/pytest-dev/pytest-xdist / handle_command

Method handle_command

src/xdist/remote.py:155–174  ·  view source on GitHub ↗
(
        self, command: tuple[str, dict[str, Any]] | Literal[Marker.SHUTDOWN]
    )

Source from the content-addressed store, hash-verified

153 self.sendevent("collectionstart")
154
155 def handle_command(
156 self, command: tuple[str, dict[str, Any]] | Literal[Marker.SHUTDOWN]
157 ) -> None:
158 if command is Marker.SHUTDOWN:
159 self.torun.put(Marker.SHUTDOWN)
160 return
161
162 name, kwargs = command
163
164 self.log("received command", name, kwargs)
165 if name == "runtests":
166 for i in kwargs["indices"]:
167 self.torun.put(i)
168 elif name == "runtests_all":
169 for i in range(len(self.session.items)):
170 self.torun.put(i)
171 elif name == "shutdown":
172 self.torun.put(Marker.SHUTDOWN)
173 elif name == "steal":
174 self.steal(kwargs["indices"])
175
176 def steal(self, indices: Sequence[int]) -> None:
177 """

Callers

nothing calls this directly

Calls 2

stealMethod · 0.95
putMethod · 0.80

Tested by

no test coverage detected