(app)
| 105 | |
| 106 | |
| 107 | def test_context_binding(app): |
| 108 | @app.route("/") |
| 109 | def index(): |
| 110 | return f"Hello {flask.request.args['name']}!" |
| 111 | |
| 112 | @app.route("/meh") |
| 113 | def meh(): |
| 114 | return flask.request.url |
| 115 | |
| 116 | with app.test_request_context("/?name=World"): |
| 117 | assert index() == "Hello World!" |
| 118 | with app.test_request_context("/meh"): |
| 119 | assert meh() == "http://localhost/meh" |
| 120 | assert not flask.request |
| 121 | |
| 122 | |
| 123 | def test_context_test(app): |
nothing calls this directly
no test coverage detected