예제 #1
0
파일: conftest.py 프로젝트: kinzer1/lemur
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()
예제 #2
0
파일: conftest.py 프로젝트: rtdean/lemur
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()
예제 #3
0
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()
예제 #4
0
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()
예제 #5
0
파일: manage.py 프로젝트: genadipost/lemur
    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()