MCPcopy Create free account
hub / github.com/pallets/flask / test_cli_custom_obj

Function test_cli_custom_obj

tests/test_testing.py:364–379  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

362
363
364def test_cli_custom_obj(app):
365 class NS:
366 called = False
367
368 def create_app():
369 NS.called = True
370 return app
371
372 @app.cli.command("hello")
373 def hello_command():
374 click.echo("Hello, World!")
375
376 script_info = ScriptInfo(create_app=create_app)
377 runner = app.test_cli_runner()
378 runner.invoke(hello_command, obj=script_info)
379 assert NS.called
380
381
382def test_client_pop_all_preserved(app, req_ctx, client):

Callers

nothing calls this directly

Calls 3

ScriptInfoClass · 0.90
test_cli_runnerMethod · 0.80
invokeMethod · 0.45

Tested by

no test coverage detected