Skip to content

Tests fail on click>=8.2.0 #38

Open
@sebix

Description

@sebix

With click version 8.2.0 released one month ago, 5 out ot 7 tests are failing:

============================================================================================================ test session starts ============================================================================================================
platform linux -- Python 3.11.11, pytest-8.3.4, pluggy-1.5.0
rootdir: /home/sebastianw/dev/click-plugins
collected 7 items                                                                                                                                                                                                                           

tests/test_plugins.py .FFF.FF                                                                                                                                                                                                         [100%]

================================================================================================================= FAILURES ==================================================================================================================
___________________________________________________________________________________________________________ test_register_and_run ___________________________________________________________________________________________________________

runner = <click.testing.CliRunner object at 0x7f34f10d8c50>

    def test_register_and_run(runner):
    
        result = runner.invoke(good_cli)
>       assert result.exit_code == 0
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_plugins.py:81: AssertionError
_______________________________________________________________________________________________________ test_broken_register_and_run ________________________________________________________________________________________________________

runner = <click.testing.CliRunner object at 0x7f34f13bf310>

    def test_broken_register_and_run(runner):
    
        result = runner.invoke(broken_cli)
>       assert result.exit_code == 0
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_plugins.py:92: AssertionError
_____________________________________________________________________________________________________________ test_group_chain ______________________________________________________________________________________________________________

runner = <click.testing.CliRunner object at 0x7f34f10cb090>

    def test_group_chain(runner):
    
        # Attach a sub-group to a CLI and get execute it without arguments to make
        # sure both the sub-group and all the parent group's commands are present
        @good_cli.group()
        def sub_cli():
            """Sub CLI."""
            pass
    
        result = runner.invoke(good_cli)
>       assert result.exit_code == 0
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_plugins.py:111: AssertionError
__________________________________________________________________________________________________ test_broken_register_and_run_with_help ___________________________________________________________________________________________________

runner = <click.testing.CliRunner object at 0x7f34f106e590>

    def test_broken_register_and_run_with_help(runner):
        result = runner.invoke(broken_cli)
>       assert result.exit_code == 0
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_plugins.py:145: AssertionError
__________________________________________________________________________________________________ test_broken_register_and_run_with_args ___________________________________________________________________________________________________

runner = <click.testing.CliRunner object at 0x7f34f0f9f410>

    def test_broken_register_and_run_with_args(runner):
        result = runner.invoke(broken_cli)
>       assert result.exit_code == 0
E       assert 2 == 0
E        +  where 2 = <Result SystemExit(2)>.exit_code

tests/test_plugins.py:156: AssertionError
========================================================================================================== short test summary info ==========================================================================================================
FAILED tests/test_plugins.py::test_register_and_run - assert 2 == 0
FAILED tests/test_plugins.py::test_broken_register_and_run - assert 2 == 0
FAILED tests/test_plugins.py::test_group_chain - assert 2 == 0
FAILED tests/test_plugins.py::test_broken_register_and_run_with_help - assert 2 == 0
FAILED tests/test_plugins.py::test_broken_register_and_run_with_args - assert 2 == 0
======================================================================================================== 5 failed, 2 passed in 0.07s ========================================================================================================

With the previous version 8.1.8 all tests succeed.

It appears the registering works different now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions