Skip to content
Myr

Removed temp subscription contextmanager in blinker tests to support upcoming api improvements better

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

authored by Armin Ronacher · committed by Armin Ronacher · parent 80268a4 · Browse files · 1 file+8 added−2 removed
This commit

State

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

Diff stats

1 file+8 added−2 removed

  • tests:+8 added−2 removed

1 file+8 added−2 removed

modified:tests/flask_tests.py+8 added-2 removed
1050 unmodified lines
1051 recorded = []1052 def record(sender, template, context):1053 recorded.append((template, context))10541055 with flask.template_rendered.temporarily_connected_to(record, app):1055 flask.template_rendered.connect(record, app)1056 try:1057 rv = app.test_client().get('/')1058 assert len(recorded) == 11059 template, context = recorded[0]1060 assert template.name == 'simple_template.html'1061 assert context['whiskey'] == 421062 finally:1063 flask.template_rendered.disconnect(record, app)10641065 def test_request_signals(self):1066 app = flask.Flask(__name__)1067 calls = []
44 unmodified lines
11121113 def record(sender, exception):1114 recorded.append(exception)11151113 with flask.got_request_exception.temporarily_connected_to(record):1116 flask.got_request_exception.connect(record, app)1117 try:1118 assert app.test_client().get('/').status_code == 5001119 assert len(recorded) == 11120 assert isinstance(recorded[0], ZeroDivisionError)1121 finally:1122 flask.got_request_exception.disconnect(record, app)112311241125def suite():1126 from minitwit_tests import MiniTwitTestCase
21 unmodified lines