code: def test_stream_keeps_session(self, app, client):
      @app.route("/")
      def index():
          flask.session["test"] = "flask"
  
          @flask.stream_with_context
          def gen():
              yield flask.session["test"]
  
          return flask.Response(gen())
  
      rv = client.get("/")
      assert rv.data == b"flask"
  
imports: import io
  import os
  import pytest
  import werkzeug.exceptions
  import flask
  from flask.helpers import get_debug_flag
label_desc: Use image node_id 4 for calling the TestStreaming obj's underlying member method code with example usage: obj.test_stream_keeps_session(app, client) and returns: flask