Create a CLI runner for testing CLI commands. See :ref:`testing-cli`. Returns an instance of :attr:`test_cli_runner_class`, by default :class:`~flask.testing.FlaskCliRunner`. The Flask app object is passed as the first argument. .. versionadded:: 1.0
(self, **kwargs: t.Any)
| 725 | ) |
| 726 | |
| 727 | def test_cli_runner(self, **kwargs: t.Any) -> FlaskCliRunner: |
| 728 | """Create a CLI runner for testing CLI commands. |
| 729 | See :ref:`testing-cli`. |
| 730 | |
| 731 | Returns an instance of :attr:`test_cli_runner_class`, by default |
| 732 | :class:`~flask.testing.FlaskCliRunner`. The Flask app object is |
| 733 | passed as the first argument. |
| 734 | |
| 735 | .. versionadded:: 1.0 |
| 736 | """ |
| 737 | cls = self.test_cli_runner_class |
| 738 | |
| 739 | if cls is None: |
| 740 | from .testing import FlaskCliRunner as cls |
| 741 | |
| 742 | return cls(self, **kwargs) # type: ignore |
| 743 | |
| 744 | def handle_http_exception( |
| 745 | self, e: HTTPException |
no outgoing calls
no test coverage detected