def tearDown(self): db.session.remove() db.get_engine(self.app).dispose() self.app_ctx.pop() redis_connection.flushdb()
def is_db_empty(): from redash.models import db table_names = sqlalchemy.inspect(db.get_engine()).get_table_names() return len(table_names) == 0