MCPcopy
hub / github.com/pallets/flask / index

Method index

tests/test_reqctx.py:154–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152
153 @app.route("/")
154 def index():
155 flask.session["fizz"] = "buzz"
156 reqctx = request_ctx.copy()
157
158 def g():
159 assert not flask.request
160 assert not flask.current_app
161 with reqctx:
162 assert flask.request
163 assert flask.current_app == app
164 assert flask.request.path == "/"
165 assert flask.request.args["foo"] == "bar"
166 assert flask.session.get("fizz") == "buzz"
167 assert not flask.request
168 return 42
169
170 greenlets.append(greenlet(g))
171 return "Hello World!"
172
173 rv = client.get("/?foo=bar")
174 assert rv.data == b"Hello World!"

Callers

nothing calls this directly

Calls 1

copyMethod · 0.80

Tested by

no test coverage detected