diff --git a/locust/runners.py b/locust/runners.py index 8327066412..efd63e1f00 100644 --- a/locust/runners.py +++ b/locust/runners.py @@ -900,23 +900,9 @@ def quit(self) -> None: def check_stopped(self) -> None: if ( - not self.state == STATE_INIT - and not self.state == STATE_STOPPED - and ( - self.state == STATE_STOPPING - and all( - map( - lambda x: x.state == STATE_INIT, - self.clients.all, - ) - ) - ) - or all( - map( - lambda x: x.state not in (STATE_RUNNING, STATE_SPAWNING, STATE_INIT), - self.clients.all, - ) - ) + self.state == STATE_STOPPING + and all(x.state == STATE_INIT for x in self.clients.all) + or all(x.state not in (STATE_RUNNING, STATE_SPAWNING, STATE_INIT) for x in self.clients.all) ): self.update_state(STATE_STOPPED)