@pytest.fixture(scope='function')
def testapp(request, app):
    ctx = app.app_context()
    ctx.push()

    def teardown():
        ctx.pop()

    request.addfinalizer(teardown)

    return app
Return basic Flask app with an established app context.
dataset/ETHPy150Open janukobytsch/flask-autofixture/tests/conftest.py/testapp