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

Function test_cli_invoke

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

Source from the content-addressed store, hash-verified

348
349
350def test_cli_invoke(app):
351 @app.cli.command("hello")
352 def hello_command():
353 click.echo("Hello, World!")
354
355 runner = app.test_cli_runner()
356 # invoke with command name
357 result = runner.invoke(args=["hello"])
358 assert "Hello" in result.output
359 # invoke with command object
360 result = runner.invoke(hello_command)
361 assert "Hello" in result.output
362
363
364def test_cli_custom_obj(app):

Callers

nothing calls this directly

Calls 2

test_cli_runnerMethod · 0.80
invokeMethod · 0.45

Tested by

no test coverage detected