Created
October 13, 2020 16:44
-
-
Save sportebois/fe2be99f27cef360961558ade6af6914 to your computer and use it in GitHub Desktop.
Flask custom test client class overridden open()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask.testing import FlaskClient | |
class ApiTestClient(FlaskClient): | |
def open(self, *args, **kw): | |
resp: Response = super().open(*args, **kw) | |
# Send a copy of the request to the sink so that it’s visible for the Akita Agent | |
resp.freeze() | |
_publish_to_exposer(kw, deepcopy(resp)) | |
return resp | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment