Skip to content
Myr

:sparkles: Add custom CliRunner and Click imports

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sebastián Ramírez · committed by Sebastián Ramírez · parent c2214d2 · Browse files · 2 files+67 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+67 added−1 removed

  • other:+67 added−1 removed

2 files+67 added−1 removed

modified:typer/__init__.py+40 added-1 removed
3 unmodified lines
45from .main import Typer, run # noqa6from .params import Option, Argument # noqa7from .models import Context, TextFile, BinaryFileRead, BinaryFileWrite # noqa89# Utilities8from click import echo # noqa10from click.utils import ( # noqa11 echo,12 get_binary_stream,13 get_text_stream,14 open_file,15 format_filename,16 get_app_dir,17 get_os_args,18)1920# Terminal functions21from click.termui import ( # noqa22 prompt,23 confirm,24 get_terminal_size,25 echo_via_pager,26 progressbar,27 clear,28 style,29 unstyle,30 secho,31 edit,32 launch,33 getchar,34 pause,35)3637from click.exceptions import ( # noqa38 ClickException,39 UsageError,40 BadParameter,41 FileError,42 Abort,43 NoSuchOption,44 BadOptionUsage,45 BadArgumentUsage,46 MissingParameter,47)
added:typer/testing.py+27 added
1from click.testing import Result, CliRunner as ClickCliRunner # noqa2from typer.main import get_command as _get_command345class CliRunner(ClickCliRunner):6 def invoke(7 self,8 cli,9 args=None,10 input=None,11 env=None,12 catch_exceptions=True,13 color=False,14 mix_stderr=False,15 **extra16 ) -> Result:17 use_cli = _get_command(cli)18 return super().invoke(19 use_cli,20 args=args,21 input=input,22 env=env,23 catch_exceptions=catch_exceptions,24 color=color,25 mix_stderr=mix_stderr,26 **extra27 )