diff --git a/tests/conftest.py b/tests/conftest.py index 91d5062..8fbcbdb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -69,6 +69,11 @@ async def wrapper( await rpc_client.rpc_commlayer.close() await rpc_server.rpc_commlayer.close() + # Clean exit + tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()] + if tasks: + await asyncio.gather(*tasks) + return result return wrapper