You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
735 B

# -*- coding: utf-8 -*-
"""
tests.subclassing
~~~~~~~~~~~~~~~~~
Test that certain behavior of flask can be customized by
subclasses.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
from flask._compat import StringIO
10 years ago
def test_suppressed_exception_logging():
class SuppressedFlask(flask.Flask):
def log_exception(self, exc_info):
pass
out = StringIO()
app = SuppressedFlask(__name__)
@app.route('/')
def index():
raise Exception('test')
10 years ago
rv = app.test_client().get('/', errors_stream=out)
10 years ago
assert rv.status_code == 500
assert b'Internal Server Error' in rv.data
assert not out.getvalue()