I need to specify different databases for different configurations, one for 
running migrations, one for units tests, one for Jenkins...

Here is what I currently do:

alembic/env.py:

def run_migrations_online():
    engine = create_engine(
        create_app('settings.yaml').config['DATABASE_URL'],
        poolclass=pool.NullPool)
    connection = engine.connect()
    context.configure(
        connection=connection,
        target_metadata=target_metadata)
    try:
        with context.begin_transaction():
            context.run_migrations()
    finally:
        connection.close()

That works for regular migrations, but not for tests. What is the standard 
way to do this?

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to