@pytest.fixture(scope='function')
def routeapp(request, testapp):
    url, url2, url3, url4 = '/lorem', '/life', '/world', '/echo'

    # Store routes for later retrieval
    testapp.routes = [url, url2, url3, url4]

    @testapp.route(url, methods=['GET'])
    def lorem():
        return jsonify(title="lorem ipsum",
                       body="lorem ipsum dolor sit amet...")

    @testapp.route(url2, methods=['GET'])
    def life():
        return jsonify(title="about life",
                       body="life is beautiful")

    @testapp.route(url3, methods=['GET'])
    def world():
        return jsonify(title="hello",
                       body="world")

    @testapp.route(url4, methods=['POST'])
    def echo():
        from flask import request
        return jsonify(echo=request.data.decode('utf8'))

    return testapp
Returns Flask app with established app context and registered routes.
dataset/ETHPy150Open janukobytsch/flask-autofixture/tests/conftest.py/routeapp