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

Function test_manual_context_binding

tests/test_reqctx.py:135–145  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

133
134
135def test_manual_context_binding(app):
136 @app.route("/")
137 def index():
138 return f"Hello {flask.request.args['name']}!"
139
140 ctx = app.test_request_context("/?name=World")
141 ctx.push()
142 assert index() == "Hello World!"
143 ctx.pop()
144 with pytest.raises(RuntimeError):
145 index()
146
147
148@pytest.mark.skipif(greenlet is None, reason="greenlet not installed")

Callers

nothing calls this directly

Calls 4

test_request_contextMethod · 0.80
indexFunction · 0.70
pushMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…