def app(request): """ Creates a new Flask application for a test duration. Uses application factory `create_app`. """ if request.config.getoption('--lemurconfig'): _app = create_app(request.config.getoption('--lemurconfig')) else: _app = create_app(os.path.dirname(os.path.realpath(__file__)) + '/conf.py') ctx = _app.app_context() ctx.push() yield _app ctx.pop()
def app(request): """ Creates a new Flask application for a test duration. Uses application factory `create_app`. """ if request.config.getoption('--lemurconfig'): _app = create_app(request.config.getoption('--lemurconfig')) else: _app = create_app( os.path.dirname(os.path.realpath(__file__)) + '/conf.py') ctx = _app.app_context() ctx.push() yield _app ctx.pop()
def app(request): """ Creates a new Flask application for a test duration. Uses application factory `create_app`. """ _app = create_app(os.path.dirname(os.path.realpath(__file__)) + '/conf.py') ctx = _app.app_context() ctx.push() yield _app ctx.pop()
def run(self, *args, **kwargs): from gunicorn.app.wsgiapp import WSGIApplication app = WSGIApplication() # run startup tasks on a app like object pre_app = create_app(kwargs.get('config')) validate_conf(pre_app, REQUIRED_VARIABLES) app.app_uri = 'lemur:create_app(config="{0}")'.format( kwargs.get('config')) return app.run()