Method: flask.testing.FlaskCliRunner.invoke
Calls: 8, Exceptions: 0, Paths: 3Back
Path 1: 6 calls (0.75)
None (6)
['customized', 'custom'] (1) ['nested', 'nested'] (1) ['merged'] (1) ['late_registration', 'late'] (1) ['blue', '--help'] (1) ['hello'] (1)
{} (6)
Result (6)
1def invoke( # type: ignore
2 self, cli: t.Any = None, args: t.Any = None, **kwargs: t.Any
3 ) -> t.Any:
4 """Invokes a CLI command in an isolated environment. See
5 :meth:`CliRunner.invoke <click.testing.CliRunner.invoke>` for
6 full method documentation. See :ref:`testing-cli` for examples.
7
8 If the ``obj`` argument is not given, passes an instance of
9 :class:`~flask.cli.ScriptInfo` that knows how to load the Flask
10 app being tested.
11
12 :param cli: Command object to invoke. Default is the app's
13 :attr:`~flask.app.Flask.cli` group.
14 :param args: List of strings to invoke the command with.
15
16 :return: a :class:`~click.testing.Result` object.
17 """
18 if cli is None:
19 cli = self.app.cli # type: ignore
20
21 if "obj" not in kwargs:
22 kwargs["obj"] = ScriptInfo(create_app=lambda: self.app)
23
24 return super().invoke(cli, args, **kwargs)
Path 2: 1 calls (0.12)
Command (1)
None (1)
{} (1)
Result (1)
1def invoke( # type: ignore
2 self, cli: t.Any = None, args: t.Any = None, **kwargs: t.Any
3 ) -> t.Any:
4 """Invokes a CLI command in an isolated environment. See
5 :meth:`CliRunner.invoke <click.testing.CliRunner.invoke>` for
6 full method documentation. See :ref:`testing-cli` for examples.
7
8 If the ``obj`` argument is not given, passes an instance of
9 :class:`~flask.cli.ScriptInfo` that knows how to load the Flask
10 app being tested.
11
12 :param cli: Command object to invoke. Default is the app's
13 :attr:`~flask.app.Flask.cli` group.
14 :param args: List of strings to invoke the command with.
15
16 :return: a :class:`~click.testing.Result` object.
17 """
18 if cli is None:
19 cli = self.app.cli # type: ignore
20
21 if "obj" not in kwargs:
22 kwargs["obj"] = ScriptInfo(create_app=lambda: self.app)
23
24 return super().invoke(cli, args, **kwargs)
Path 3: 1 calls (0.12)
Command (1)
None (1)
dict (1)
Result (1)
1def invoke( # type: ignore
2 self, cli: t.Any = None, args: t.Any = None, **kwargs: t.Any
3 ) -> t.Any:
4 """Invokes a CLI command in an isolated environment. See
5 :meth:`CliRunner.invoke <click.testing.CliRunner.invoke>` for
6 full method documentation. See :ref:`testing-cli` for examples.
7
8 If the ``obj`` argument is not given, passes an instance of
9 :class:`~flask.cli.ScriptInfo` that knows how to load the Flask
10 app being tested.
11
12 :param cli: Command object to invoke. Default is the app's
13 :attr:`~flask.app.Flask.cli` group.
14 :param args: List of strings to invoke the command with.
15
16 :return: a :class:`~click.testing.Result` object.
17 """
18 if cli is None:
19 cli = self.app.cli # type: ignore
20
21 if "obj" not in kwargs:
22 kwargs["obj"] = ScriptInfo(create_app=lambda: self.app)
23
24 return super().invoke(cli, args, **kwargs)