diff --git a/kdb-bot/test/ui_tests_shared/decorators.py b/kdb-bot/test/ui_tests_shared/decorators.py index b0359204..67bcb6a1 100644 --- a/kdb-bot/test/ui_tests_shared/decorators.py +++ b/kdb-bot/test/ui_tests_shared/decorators.py @@ -2,14 +2,13 @@ import asyncio class Async: - _loop = None @classmethod def test(cls, coro): def wrapper(*args, **kwargs): - if cls._loop is None: - cls._loop = asyncio.get_event_loop() - - return cls._loop.run_until_complete(coro(*args, **kwargs)) + try: + return asyncio.run(coro(*args, **kwargs)) + except Exception as e: + return return wrapper