-
Notifications
You must be signed in to change notification settings - Fork 89
Description
I currently have a problem with errors when I try to test a streaming endpoint, namely when I use the stream_with_context flask function/decorator to keep the context around, as I am streaming from a database which client is on current_app.
Essentially, the test passes, but then pytest-flask errors with a message about it having popped the wrong request context:
AssertionError: Popped wrong request context. (<RequestContext 'http://localhost/stream' [GET] of app> instead of <RequestContext 'http://localhost/' [GET] of app>)
Or at least I think it's pytest-flask.
I have a small gist that demonstrates the issue: https://gist.github.com/cknv/152d81ffcc4a74be491d, though it might be a little on the primitive side, but for me it does demonstrate the error. If you need some more information, I would of course be more than happy to provide it :)
For completeness sake, I am running python 3.5.