test_subclassing.py
This file
Path
tests/test_subclassing.py
33 lines · 736 bytes · Python
Last changed by
Merge pull request #2624 from pallets/metadataDavid Lordbefore adoption4309c7c
History of this fileTake it
The walk stopped after 200 commits: lines older than d2a46dc point at it.
fix doc build errorDavid Lordbefore adoptiond2a46dc
lines 1–8why, one step back1# -*- coding: utf-8 -*-2"""3 tests.subclassing4 ~~~~~~~~~~~~~~~~~56 Test that certain behavior of flask can be customized by7 subclasses.8Merge pull request #2624 from pallets/metadataDavid Lordbefore adoption4309c7c
line 9why, one step back9 :copyright: © 2010 by the Pallets team.fix doc build errorDavid Lordbefore adoptiond2a46dc
lines 10–11why, one step back10 :license: BSD, see LICENSE for more details.11"""Merge pull request #2436 from davidism/loggingDavid Lordbefore adoptionc74f469
line 12why, one step back12fix doc build errorDavid Lordbefore adoptiond2a46dc
lines 13–27why, one step back13import flask1415from flask._compat import StringIO161718def test_suppressed_exception_logging():19 class SuppressedFlask(flask.Flask):20 def log_exception(self, exc_info):21 pass2223 out = StringIO()24 app = SuppressedFlask(__name__)2526 @app.route('/')27 def index():Merge pull request #2436 from davidism/loggingDavid Lordbefore adoptionc74f469
line 28why, one step back28 raise Exception('test')fix doc build errorDavid Lordbefore adoptiond2a46dc
line 29why, one step back29Merge pull request #2436 from davidism/loggingDavid Lordbefore adoptionc74f469
line 30why, one step back30 rv = app.test_client().get('/', errors_stream=out)fix doc build errorDavid Lordbefore adoptiond2a46dc
lines 31–32why, one step back31 assert rv.status_code == 50032 assert b'Internal Server Error' in rv.dataMerge pull request #2436 from davidism/loggingDavid Lordbefore adoptionc74f469
line 33why, one step back33 assert not out.getvalue()