Coverage for typer/testing.py: 100%
9 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-04-14 00:18 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-04-14 00:18 +0000
1from typing import IO, Any, Mapping, Optional, Sequence, Union 1iabcdefgh
3from click.testing import CliRunner as ClickCliRunner # noqa 1iabcdefgh
4from click.testing import Result 1iabcdefgh
5from typer.main import Typer 1iabcdefgh
6from typer.main import get_command as _get_command 1iabcdefgh
9class CliRunner(ClickCliRunner): 1iabcdefgh
10 def invoke( # type: ignore 1abcdefgh
11 self,
12 app: Typer,
13 args: Optional[Union[str, Sequence[str]]] = None,
14 input: Optional[Union[bytes, str, IO[Any]]] = None,
15 env: Optional[Mapping[str, str]] = None,
16 catch_exceptions: bool = True,
17 color: bool = False,
18 **extra: Any,
19 ) -> Result:
20 use_cli = _get_command(app) 1iabcdefgh
21 return super().invoke( 1iabcdefgh
22 use_cli,
23 args=args,
24 input=input,
25 env=env,
26 catch_exceptions=catch_exceptions,
27 color=color,
28 **extra,
29 )