Minor readability improvement

This commit is contained in:
2022-03-27 17:07:29 +02:00
parent 491f92ca60
commit 3f483243d9

View File

@ -539,13 +539,10 @@ class BaseServerTestCase(
if self.run_services: if self.run_services:
self.controller.wait_for_services() self.controller.wait_for_services()
if not name: if not name:
new_name: int = ( used_ids: List[int] = [
max( int(name) for name in self.clients if isinstance(name, (int, str))
[int(name) for name in self.clients if isinstance(name, (int, str))] ]
+ [0] new_name = max(used_ids + [0]) + 1
)
+ 1
)
name = cast(TClientName, new_name) name = cast(TClientName, new_name)
show_io = show_io if show_io is not None else self.show_io show_io = show_io if show_io is not None else self.show_io
self.clients[name] = client_mock.ClientMock(name=name, show_io=show_io) self.clients[name] = client_mock.ClientMock(name=name, show_io=show_io)