mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Use alembic in tests again?
This commit is contained in:
parent
5c1732d119
commit
b4a3a87e6e
2 changed files with 12 additions and 3 deletions
|
|
@ -68,4 +68,10 @@ async def run_migrations_online() -> None:
|
|||
if context.is_offline_mode():
|
||||
run_migrations_offline()
|
||||
else:
|
||||
asyncio.run(run_migrations_online())
|
||||
# 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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue