1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Improve loops and lists (#113269)

* Enable PERF

* Enable PERF rule

* Enable PERF rule

* Don't enable flag yet
This commit is contained in:
Joost Lekkerkerker
2024-03-14 10:22:20 +01:00
committed by GitHub
parent 8a98fb7cfd
commit 05172d8e4d
30 changed files with 125 additions and 172 deletions

View File

@@ -3915,9 +3915,9 @@ async def test_entry_reload_concurrency(
),
)
mock_platform(hass, "comp.config_flow", None)
tasks = []
for _ in range(15):
tasks.append(asyncio.create_task(manager.async_reload(entry.entry_id)))
tasks = [
asyncio.create_task(manager.async_reload(entry.entry_id)) for _ in range(15)
]
await asyncio.gather(*tasks)
assert entry.state is config_entries.ConfigEntryState.LOADED
assert loaded == 1