Flask Test Cli Runner Api
# Flask Test CLI Runner API
FlaskCliRunner is based on Click's CliRunner, used for testing Flask CLI commands.
Create an instance via app.test_cli_runner().
* * *
## Creation Methods
| Method | Description |
| --- | --- |
| app.test_cli_runner(**kwargs) | Create a CLI test runner. kwargs are passed to the CliRunner constructor |
* * *
## Core Methods
| Method | Description |
| --- | --- |
| invoke(cli=None, args=None, **kwargs) | Invoke a CLI command. Defaults to using app.cli. Returns a click.testing.Result object |
* * *
## Result Object Attributes
| Attribute | Description |
| --- | --- |
| exit_code | Command exit code. 0 indicates success |
| output | Standard output content of the command (str) |
| exception | If the command raises an exception, contains the exception object |
* * *
## Code Examples
## Example
from app import create_app
app = create_app()
ru
YouTip