apply updated pre-commit hooks
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent ff06d50 · Browse files · 5 files·+14 added−20 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+14 added−20 removed
- tests:+13 added−19 removed
- other:+1 added−1 removed
Provenance
- Commit
3f44bac- Tree
6a8e8bc- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
ff06d50
5 files changed+14 added−20 removed
modified:src/click/globals.py+1 added-1 removed
34 unmodified lines35 _local.stack.pop()36 37 38 def resolve_color_default(color=None):39- """"Internal helper to get the default value of the color flag. If a39+ """Internal helper to get the default value of the color flag. If a40 value is passed it's returned unchanged, otherwise it's looked up from41 the current context.42 """43 if color is not None:4 unmodified linesmodified:tests/test_formatting.py+9 added-13 removed
50 unmodified lines51 52 def test_wrapping_long_options_strings(runner):53 @click.group()54 def cli():55- """Top level command56- """55+ """Top level command"""56 57 @cli.group()58 def a_very_long():60- """Second level61- """59+ """Second level"""60 61 @a_very_long.command()62 @click.argument("first")63 @click.argument("second")1 unmodified line65 @click.argument("fourth")66 @click.argument("fifth")67 @click.argument("sixth")68 def command():71- """A command.72- """69+ """A command."""70 71 # 54 is chosen as a length where the second line is one character72 # longer than the maximum length.73 result = runner.invoke(cli, ["a-very-long", "command", "--help"], terminal_width=54)12 unmodified lines86 87 def test_wrapping_long_command_name(runner):88 @click.group()89 def cli():93- """Top level command94- """90+ """Top level command"""91 92 @cli.group()93 def a_very_very_very_long():98- """Second level99- """94+ """Second level"""95 96 @a_very_very_very_long.command()97 @click.argument("first")98 @click.argument("second")1 unmodified line100 @click.argument("fourth")101 @click.argument("fifth")102 @click.argument("sixth")103 def command():109- """A command.110- """104+ """A command."""105 106 result = runner.invoke(107 cli, ["a-very-very-very-long", "command", "--help"], terminal_width=54108 )12 unmodified lines121 122 def test_formatting_empty_help_lines(runner):123 @click.command()124 def cli():125+ # fmt: off126 """Top level command127 128 """129+ # fmt: on130 131 result = runner.invoke(cli, ["--help"])132 assert not result.exception133 assert result.output.splitlines() == [167 unmodified lines301 @click.option("-f", "in_file", default="out.txt", help="Output file name")302 def cli():303 pass304 309- result = runner.invoke(cli, ["--help"],)305+ result = runner.invoke(cli, ["--help"])306 assert result.output.splitlines() == [307 "Usage: cli [OPTIONS]",308 "",309 "Options:",45 unmodified linesmodified:tests/test_options.py+2 added-2 removed
486 unmodified lines487 )488 def cmd(config):489 pass490 491- result = runner.invoke(cmd, ["--help"],)491+ result = runner.invoke(cmd, ["--help"])492 assert result.exit_code == 0493 i = " " * 21494 assert (495 " -C, --config PATH Configuration file to use.\n"156 unmodified lines652 """When a boolean flag only has one opt, it will show the default653 value, not the opt name.654 """655 opt = click.Option(656- ("--cache",), is_flag=True, show_default=True, help="Enable the cache.",656+ ("--cache",), is_flag=True, show_default=True, help="Enable the cache."657 )658 ctx = click.Context(click.Command("test"))659 message = opt.get_help_record(ctx)[1]660 assert "[default: False]" in message31 unmodified linesmodified:tests/test_shell_completion.py+1 added-3 removed
261 unmodified lines262 "click.shell_completion.BashComplete._check_version", lambda self: True263 )264 265 266-@pytest.mark.parametrize(267- "shell", ["bash", "zsh", "fish"],268-)266+@pytest.mark.parametrize("shell", ["bash", "zsh", "fish"])267 @pytest.mark.usefixtures("_patch_for_completion")268 def test_full_source(runner, shell):269 cli = Group("cli", commands=[Command("a"), Command("b")])270 result = runner.invoke(cli, env={"_CLI_COMPLETE": f"{shell}_source"})44 unmodified linesmodified:tests/test_termui.py+1 added-1 removed
378 unmodified lines379 assert click.getchar() == f"{special_key_char}{key_char}"380 381 382 @pytest.mark.parametrize(383- ("key_char", "exc"), [("\x03", KeyboardInterrupt), ("\x1a", EOFError)],383+ ("key_char", "exc"), [("\x03", KeyboardInterrupt), ("\x1a", EOFError)]384 )385 @pytest.mark.skipif(not WIN, reason="Tests user-input using the msvcrt module.")386 def test_getchar_windows_exceptions(runner, monkeypatch, key_char, exc):387 monkeypatch.setattr(click._termui_impl.msvcrt, "getwch", lambda: key_char)61 unmodified lines