Skip to content
Myr

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 file

Take 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 back
1# -*- coding: utf-8 -*-
2"""3 tests.subclassing4 ~~~~~~~~~~~~~~~~~56 Test that certain behavior of flask can be customized by7 subclasses.8

Merge pull request #2624 from pallets/metadataDavid Lordbefore adoption4309c7c

line 9why, one step back
9 :copyright: © 2010 by the Pallets team.

Merge pull request #2370 from tony/patch-2David Lordbefore adoptione97f6e2

lines 10–11why, one step back
10 :license: BSD, see LICENSE for more details.
11"""

Merge pull request #2436 from davidism/loggingDavid Lordbefore adoptionc74f469

line 12why, one step back
12

Merge pull request #2370 from tony/patch-2David Lordbefore adoptione97f6e2

lines 13–25why, one step back
13import flask
1415from 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__)25

Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032

line 26why, one step back
26 @app.route("/")

Merge pull request #2370 from tony/patch-2David Lordbefore adoptione97f6e2

line 27why, one step back
27 def index():

Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032

line 28why, one step back
28 raise Exception("test")

Merge pull request #2370 from tony/patch-2David Lordbefore adoptione97f6e2

line 29why, one step back
29

Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032

line 30why, one step back
30 rv = app.test_client().get("/", errors_stream=out)

Merge pull request #2370 from tony/patch-2David Lordbefore adoptione97f6e2

line 31why, one step back
31 assert rv.status_code == 500

Merge pull request #3183 from singingwolfboy/pre-commitDavid Baumgoldbefore adoption1dda032

line 32why, one step back
32 assert b"Internal Server Error" in rv.data

Merge pull request #2436 from davidism/loggingDavid Lordbefore adoptionc74f469

line 33why, one step back
33 assert not out.getvalue()