Skip to content
Myr

Merge branch '0.10-maintenance'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Neuhäuser · committed by Daniel Neuhäuser · parents 544118b, a3a2f52 · Browse files · 4 files+40 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+40 added−0 removed

  • other:+40 added−0 removed

4 files+40 added−0 removed

modified:flask/testsuite/appctx.py+17 added
61 unmodified lines
62 pass6364 self.assert_equal(cleanup_stuff, [None])6566 def test_app_tearing_down_with_previous_exception(self):67 cleanup_stuff = []68 app = flask.Flask(__name__)69 @app.teardown_appcontext70 def cleanup(exception):71 cleanup_stuff.append(exception)7273 try:74 raise Exception('dummy')75 except Exception:76 pass7778 with app.app_context():79 pass8081 self.assert_equal(cleanup_stuff, [None])8283 def test_custom_app_ctx_globals_class(self):84 class CustomRequestGlobals(object):85 def __init__(self):86 self.spam = 'eggs'
32 unmodified lines
modified:flask/testsuite/reqctx.py+16 added
31 unmodified lines
32 self.assert_equal(buffer, [])33 ctx.pop()34 self.assert_equal(buffer, [None])3536 def test_teardown_with_previous_exception(self):37 buffer = []38 app = flask.Flask(__name__)39 @app.teardown_request40 def end_of_request(exception):41 buffer.append(exception)4243 try:44 raise Exception('dummy')45 except Exception:46 pass4748 with app.test_request_context():49 self.assert_equal(buffer, [])50 self.assert_equal(buffer, [None])5152 def test_proper_test_request_context(self):53 app = flask.Flask(__name__)54 app.config.update(55 SERVER_NAME='localhost.localdomain:5000'
146 unmodified lines
modified:flask/ctx.py+5 added
161 unmodified lines
162163 def push(self):164 """Binds the app context to the current context."""165 self._refcnt += 1166 if hasattr(sys, 'exc_clear'):167 sys.exc_clear()168 _app_ctx_stack.push(self)169 appcontext_pushed.send(self.app)170171 def pop(self, exc=None):
141 unmodified lines
313 self._implicit_app_ctx_stack.append(app_ctx)314 else:315 self._implicit_app_ctx_stack.append(None)316317 if hasattr(sys, 'exc_clear'):318 sys.exc_clear()319320 _request_ctx_stack.push(self)321322 # Open the session at the moment that the request context is323 # available. This allows a custom open_session method to use the
76 unmodified lines
modified:CHANGES+2 added
22 unmodified lines
23- Fixed broken `test_appcontext_signals()` test case.24- Raise an :exc:`AttributeError` in :func:`flask.helpers.find_package` with a25 useful message explaining why it is raised when a PEP 302 import hook is used26 without an `is_package()` method.27- Fixed an issue causing exceptions raised before entering a request or app28 context to be passed to teardown handlers.2930Version 0.10.131--------------32
457 unmodified lines