Skip to content

Commit

Permalink
fix: have a seperate loop for every test
Browse files Browse the repository at this point in the history
  • Loading branch information
galuszkak committed Jan 14, 2025
1 parent 69822e9 commit 61329e1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@


def async_test(coro):
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

def wrapper(*args, **kwargs):
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
future = coro(*args, **kwargs)
return asyncio.get_event_loop().run_until_complete(future)
return loop.run_until_complete(future)

return wrapper

Expand Down

0 comments on commit 61329e1

Please sign in to comment.