Skip to content

[self-tests] tests fail with click 8.4.0 #132

@stanislavlevin

Description

@stanislavlevin

Some tests started to fail with click 8.4.0:

________________________________________________________ test_suggestion_group _________________________________________________________

advanced_file_regression = <coincidence.regressions.AdvancedFileRegressionFixture object at 0x7f4c0b826460>
cli_runner = <consolekit.testing.CliRunner object at 0x7f4c0b9d3ae0>

    def test_suggestion_group(
                advanced_file_regression: AdvancedFileRegressionFixture,
                cli_runner: CliRunner,
                ):
    
        @click_group(context_settings={**CONTEXT_SETTINGS, "token_normalize_func": lambda x: x.lower()})
        def demo() -> None:
                """
                A program.
                """
    
        @demo.command()  # skipcq
        def search() -> None:
                """
                Conduct a search.
                """
    
        result = cli_runner.invoke(demo, args=["searh"])
>       result.check_stdout(advanced_file_regression, extension="_success.md")
E    AssertionError: FILES DIFFER:
E    /usr/src/tmp/pytest-of-builder/pytest-2/test_suggestion_group0/test_commands_/test_suggestion_group_success.md
E    /usr/src/tmp/pytest-of-builder/pytest-2/test_suggestion_group0/test_commands_/test_suggestion_group_success.obtained_success.md
E    HTML DIFF: /usr/src/tmp/pytest-of-builder/pytest-2/test_suggestion_group0/test_commands_/test_suggestion_group_success.obtained_success.diff.html
E    --- 
E    +++ 
E    @@ -1,5 +1,5 @@
E     Usage: demo [OPTIONS] COMMAND [ARGS]...
E    -Try 'demo -h' for help.
E    +Try 'demo --help' for help.
E     
E     Error: No such command 'searh'.
E     The most similar command is 'search'.

tests/test_commands.py:315: AssertionError

https://github.com/pallets/click/releases/tag/8.4.0

The error hint now uses Command.get_help_option_names to pick
non-shadowed help option names, so Try '... -h' no longer points to a
subcommand option that shadows -h. All surviving names are shown
(-h/--help). pallets/click#2790 pallets/click#3208

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions