def drop_database(): _app = create_app(env_name='TEST') ctx = _app.app_context() ctx.push() from middleman import db db.drop_all()
def app(drop_database, request): _app = create_app(env_name='TEST') ctx = _app.app_context() ctx.push() from middleman import db db.drop_all() db.create_all() request.addfinalizer(lambda: ctx.pop()) return _app