generate a blank response object for testing
I'm not sure I fully understand, but what's wrong with
from flask import Responseresponse = Response()
?
What about subclassing a class you want to fake?
import flaskclass FakeResponse(flask.Response): def __init__(self, response=None, status=None, headers=None, mimetype=None, content_type=None, direct_passthrough=False): self.headers = {} self.status_code = 200 self.text = ""
As an advantage, FakeResponse interface would strictly conform original Response object (it'll include all properties and methods of original one).