def run_migrations_online(target_metadata, version_table): """Run migrations in 'online' mode. In this scenario we need to create an Engine and associate a connection with the context. :param target_metadata: Model's metadata used for autogenerate support. :param version_table: Override the default version table for alembic. """ engine = db.get_engine() with engine.connect() as connection: context.configure(connection=connection, target_metadata=target_metadata, version_table=version_table) with context.begin_transaction(): context.run_migrations()
def tearDown(self): db.get_engine().dispose() self.auth.stop() self.session.stop() super(TestCase, self).tearDown()
def stop_fixture(self): if self.conf: self.conf.reset() db.get_engine().dispose()
def tearDown(self): db.get_engine().dispose() super(TestCase, self).tearDown()