MCPcopy Index your code
hub / github.com/pallets/flask / test_cli_custom_obj

Function test_cli_custom_obj

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

Source from the content-addressed store, hash-verified

351
352
353def test_cli_custom_obj(app):
354 class NS:
355 called = False
356
357 def create_app():
358 NS.called = True
359 return app
360
361 @app.cli.command("hello")
362 def hello_command():
363 click.echo("Hello, World!")
364
365 script_info = ScriptInfo(create_app=create_app)
366 runner = app.test_cli_runner()
367 runner.invoke(hello_command, obj=script_info)
368 assert NS.called
369
370
371def 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…