forked from orbit-oss/flask
Add test and changes
This commit is contained in:
parent
12c49c75fb
commit
d0e2e7b66c
2 changed files with 35 additions and 0 deletions
15
CHANGES
15
CHANGES
|
|
@ -3,6 +3,21 @@ Flask Changelog
|
|||
|
||||
Here you can see the full list of changes between each Flask release.
|
||||
|
||||
Version 0.13
|
||||
------------
|
||||
|
||||
Major release, unreleased
|
||||
|
||||
- Make `app.run()` into a noop if a Flask application is run from the
|
||||
development server on the command line. This avoids some behavior that
|
||||
was confusing to debug for newcomers.
|
||||
- Change default configuration `JSONIFY_PRETTYPRINT_REGULAR=False`. jsonify()
|
||||
method returns compressed response by default, and pretty response in
|
||||
debug mode.
|
||||
- Call `ctx.auto_pop` with the exception object instead of `None`, in the
|
||||
event that a `BaseException` such as `KeyboardInterrupt` is raised in a
|
||||
request handler.
|
||||
|
||||
Version 0.12.1
|
||||
--------------
|
||||
|
||||
|
|
|
|||
|
|
@ -791,6 +791,26 @@ def test_error_handling_processing():
|
|||
assert resp.data == b'internal server error'
|
||||
|
||||
|
||||
def test_baseexception_error_handling():
|
||||
app = flask.Flask(__name__)
|
||||
app.config['LOGGER_HANDLER_POLICY'] = 'never'
|
||||
|
||||
@app.route('/')
|
||||
def broken_func():
|
||||
raise KeyboardInterrupt()
|
||||
|
||||
with app.test_client() as c:
|
||||
try:
|
||||
c.get('/')
|
||||
raise AssertionError("KeyboardInterrupt should have been raised")
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
ctx = flask._request_ctx_stack.top
|
||||
assert ctx.preserved
|
||||
assert type(ctx._preserved_exc) is KeyboardInterrupt
|
||||
|
||||
|
||||
def test_before_request_and_routing_errors():
|
||||
app = flask.Flask(__name__)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue