Skip to content
Myr

test_subclassing.py

This file

Path

tests/test_subclassing.py

21 lines · 475 bytes · Python

Last changed by

Not known.

History of this file

Take it

1from io import StringIO23import flask456def test_suppressed_exception_logging():7    class SuppressedFlask(flask.Flask):8        def log_exception(self, exc_info):9            pass1011    out = StringIO()12    app = SuppressedFlask(__name__)1314    @app.route("/")15    def index():16        raise Exception("test")1718    rv = app.test_client().get("/", errors_stream=out)19    assert rv.status_code == 50020    assert b"Internal Server Error" in rv.data21    assert not out.getvalue()