nomos-specs/mixnet/test_utils.py

13 lines
250 B
Python
Raw Normal View History

2024-01-25 09:04:55 +00:00
import asyncio
def with_test_timeout(t):
def wrapper(coroutine):
async def run(*args, **kwargs):
async with asyncio.timeout(t):
return await coroutine(*args, **kwargs)
return run
return wrapper