MCPcopy Create free account
hub / github.com/pallets/flask / test_wsgi_errors_stream

Function test_wsgi_errors_stream

tests/test_logging.py:54–67  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

52
53
54def test_wsgi_errors_stream(app, client):
55 @app.route("/")
56 def index():
57 app.logger.error("test")
58 return ""
59
60 stream = StringIO()
61 client.get("/", errors_stream=stream)
62 assert "ERROR in test_logging: test" in stream.getvalue()
63
64 assert wsgi_errors_stream._get_current_object() is sys.stderr
65
66 with app.test_request_context(errors_stream=stream):
67 assert wsgi_errors_stream._get_current_object() is stream
68
69
70def test_has_level_handler():

Callers

nothing calls this directly

Calls 2

test_request_contextMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected