code: def test_wsgi_errors_stream(app, client):
      @app.route("/")
      def index():
          app.logger.error("test")
          return ""
  
      stream = StringIO()
      client.get("/", errors_stream=stream)
      assert "ERROR in test_logging: test" in stream.getvalue()
  
      assert wsgi_errors_stream._get_current_object() is sys.stderr
  
      with app.test_request_context(errors_stream=stream):
          assert wsgi_errors_stream._get_current_object() is stream
  
file_path: flask/tests/test_logging.py
imports: import logging
  import sys
  from io import StringIO
  import pytest
  from flask.logging import default_handler
  from flask.logging import has_level_handler
  from flask.logging import wsgi_errors_stream
label_desc: Use image node_id 5 for calling a global function with example usage: test_wsgi_errors_stream(app, client) and returns: str