From be85506e8ea9111725dd5e19aa38f02b07da1046 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Wed, 30 Apr 2025 20:16:59 +0200 Subject: [PATCH] Use a dictionary comprehension instead --- tests/test_group.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/test_group.py b/tests/test_group.py index 1e4f31b5d6..b4dace2568 100644 --- a/tests/test_group.py +++ b/tests/test_group.py @@ -1583,14 +1583,12 @@ async def test_create_hierarchy( sync_group.create_hierarchy(store=store, nodes=hierarchy_spec, overwrite=overwrite) ) elif impl == "async": - created = dict( - [ - a - async for a in create_hierarchy( - store=store, nodes=hierarchy_spec, overwrite=overwrite - ) - ] - ) + created = { + k: v + async for k, v in create_hierarchy( + store=store, nodes=hierarchy_spec, overwrite=overwrite + ) + } else: raise ValueError(f"Invalid impl: {impl}") if not overwrite: