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

Function test_with_appcontext

tests/test_cli.py:307–317  ·  view source on GitHub ↗
(runner)

Source from the content-addressed store, hash-verified

305
306
307def test_with_appcontext(runner):
308 @click.command()
309 @with_appcontext
310 def testcmd():
311 click.echo(current_app.name)
312
313 obj = ScriptInfo(create_app=lambda: Flask("testapp"))
314
315 result = runner.invoke(testcmd, obj=obj)
316 assert result.exit_code == 0
317 assert result.output == "testapp\n"
318
319
320def test_appgroup_app_context(runner):

Callers

nothing calls this directly

Calls 3

ScriptInfoClass · 0.90
FlaskClass · 0.90
invokeMethod · 0.45

Tested by

no test coverage detected