| 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 | """ |