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

Function test_manual_context_binding

tests/test_reqctx.py:135–145  ·  tests/test_reqctx.py::test_manual_context_binding
(app)

Source from the content-addressed store, hash-verified

133
134
135def test_manual_context_binding(app):
136 @app.route(class="st">"/")
137 def index():
138 return fclass="st">"Hello {flask.request.args[&class="cm">#x27;name']}!"
139
140 ctx = app.test_request_context(class="st">"/?name=World")
141 ctx.push()
142 assert index() == class="st">"Hello World!"
143 ctx.pop()
144 with pytest.raises(RuntimeError):
145 index()
146
147
148@pytest.mark.skipif(greenlet is None, reason=class="st">"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