test_subclassing.py
This file
Path
tests/test_subclassing.py
33 lines · 736 bytes · Python
Last changed by
Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
History of this fileTake it
The walk stopped after 200 commits: lines older than e97f6e2 point at it.
Merge pull request #2370 from tony/patch-2David Lordbefore adoptione97f6e2
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.Merge pull request #2370 from tony/patch-2David Lordbefore adoptione97f6e2
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 back12Merge pull request #2370 from tony/patch-2David Lordbefore adoptione97f6e2
lines 13–25why, 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__)25Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 26why, one step back26 @app.route("/")Merge pull request #2370 from tony/patch-2David Lordbefore adoptione97f6e2
line 27why, one step back27 def index():Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 28why, one step back28 raise Exception("test")Merge pull request #2370 from tony/patch-2David Lordbefore adoptione97f6e2
line 29why, one step back29Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 30why, one step back30 rv = app.test_client().get("/", errors_stream=out)Merge pull request #2370 from tony/patch-2David Lordbefore adoptione97f6e2
line 31why, one step back31 assert rv.status_code == 500Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032
line 32why, one step back32 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()