Give up on migrations in tests

This commit is contained in:
stijndcl 2022-06-30 15:20:54 +02:00
parent b4a3a87e6e
commit 60382b8eab
5 changed files with 6 additions and 18 deletions

View file

@ -68,10 +68,4 @@ async def run_migrations_online() -> None:
if context.is_offline_mode():
run_migrations_offline()
else:
# Wonky way to use the Pytest event loop instead of another one
try:
loop = asyncio.get_running_loop()
if loop and loop.is_running():
loop.create_task(run_migrations_online())
except RuntimeError:
asyncio.run(run_migrations_online())
asyncio.run(run_migrations_online())