@pytest.yield_fixture(scope='session')
def app():
    db_uri = '{0}_test'.format(settings.SQLALCHEMY_DATABASE_URI)
    params = {
        'DEBUG': False,
        'TESTING': True,
        'WTF_CSRF_ENABLED': False,
        'SQLALCHEMY_DATABASE_URI': db_uri
    }

    _app = create_app(settings_override=params)

    # Establish an application context before running the tests.
    ctx = _app.app_context()
    ctx.push()

    yield _app

    ctx.pop()
Setup our flask test app, this only gets executed once.
dataset/ETHPy150Open nickjj/build-a-saas-app-with-flask/catwatch/tests/conftest.py/app