Skip to content

[self-tests] test_prompt_option fails against click 8.3.1 #128

@stanislavlevin

Description

@stanislavlevin

Running tests against click 8.3.1 fails with:

___________________________ test_prompt_option[8.2] ____________________________

advanced_file_regression = <coincidence.regressions.AdvancedFileRegressionFixture object at 0x7fcc892b8840>
click_version = '8.2'
cli_runner = <consolekit.testing.CliRunner object at 0x7fcc892ba7c0>

    @pytest.mark.parametrize(
                "click_version",
                [
                                pytest.param('7', marks=click_8_only),
                                pytest.param('8', marks=not_click_8_or_above_82),
                                pytest.param("8.2", marks=not_click_8_or_below_82),
                                ],
                )
    def test_prompt_option(
                advanced_file_regression: AdvancedFileRegressionFixture,
                click_version: str,
                cli_runner: CliRunner,
                ):
    
        @click.option(
                        "-s",
                        "--station",
                        help="The station to play.",
                        type=click.Choice(["Radio 1", "Radio 2", "Radio 3"], case_sensitive=False),
                        cls=PromptOption,
                        prompt="Select a station",
                        )
        @click_command()
        def main(station: str) -> None:
                print(f"Tuning to station: {station}")
    
        result = cli_runner.invoke(main, input="Radio 4\nRadio 2\n")
        assert result.exit_code == 0
>       advanced_file_regression.check(result.stdout.rstrip())
E    AssertionError: FILES DIFFER:
E    /usr/src/tmp/pytest-of-builder/pytest-0/test_prompt_option_8_2_0/test_options_/test_prompt_option_8_2_.txt
E    /usr/src/tmp/pytest-of-builder/pytest-0/test_prompt_option_8_2_0/test_options_/test_prompt_option_8_2_.obtained.txt
E    HTML DIFF: /usr/src/tmp/pytest-of-builder/pytest-0/test_prompt_option_8_2_0/test_options_/test_prompt_option_8_2_.obtained.diff.html
E    --- 
E    +++ 
E    @@ -1,4 +1,4 @@
E    -Select a station (Radio 1, Radio 2, Radio 3): Radio 4
E    +Select a station (Radio 1, Radio 2, Radio 3) [Sentinel.UNSET]: Radio 4
E     Error: 'Radio 4' is not one of 'radio 1', 'radio 2', 'radio 3'.
E    -Select a station (Radio 1, Radio 2, Radio 3): Radio 2
E    +Select a station (Radio 1, Radio 2, Radio 3) [Sentinel.UNSET]: Radio 2
E     Tuning to station: Radio 2

tests/test_options.py:420: AssertionError

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions