I have a flask api which I have wrapped up in an object. Doing this has made unit testing a breeze, because I can instantiate the api with a variety of different settings de
You could create the blueprint dynamically in a constructor function:
def construct_blueprint(database): myblueprint = Blueprint('myblueprint', __name__) @myblueprint.route('/route', methods=['GET']) def route(): database = database return(myblueprint)