Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_group_chain fails with python-click 6.7+git20180829-1 #19

Closed
sebastic opened this issue Sep 12, 2018 · 4 comments
Closed

test_group_chain fails with python-click 6.7+git20180829-1 #19

sebastic opened this issue Sep 12, 2018 · 4 comments

Comments

@sebastic
Copy link

sebastic commented Sep 12, 2018

As reported by Adrian Bunk in Debian Bug #908684, the python-click-plugins package fails to build with python-click 6.7+git20180829-1 due to a test failure:

I: pybuild pybuild:269: cp -r /build/python-click-plugins-1.0.2/tests /build/python-click-plugins-1.0.2/.pybuild/cpython2_2.7_click-plugins/build
I: pybuild base:217: cd /build/python-click-plugins-1.0.2/.pybuild/cpython2_2.7_click-plugins/build; python2.7 -m pytest tests
============================= test session starts ==============================
platform linux2 -- Python 2.7.15+, pytest-3.6.4, py-1.6.0, pluggy-0.6.0
rootdir: /build/python-click-plugins-1.0.2, inifile:
collected 5 items

tests/test_plugins.py ...F.                                              [100%]

=================================== FAILURES ===================================
_______________________________ test_group_chain _______________________________

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

    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 is 0
        assert sub_cli.name in result.output
        for ep in iter_entry_points('_test_click_plugins.test_plugins'):
            assert ep.name in result.output
    
        # Same as above but the sub-group has plugins
        @with_plugins(plugins=iter_entry_points('_test_click_plugins.test_plugins'))
        @good_cli.group()
        def sub_cli_plugins():
            """Sub CLI with plugins."""
            pass
    
        result = runner.invoke(good_cli, ['sub_cli_plugins'])
>       assert result.exit_code is 0
E       assert 2 is 0
E        +  where 2 = <Result SystemExit(2,)>.exit_code

tests/test_plugins.py:124: AssertionError
====================== 1 failed, 4 passed in 0.12 seconds ======================
E: pybuild pybuild:338: test: plugin distutils failed with: exit code=1: cd /build/python-click-plugins-1.0.2/.pybuild/cpython2_2.7_click-plugins/build; python2.7 -m pytest tests

The python-click package was recently updated to a git snapshot which likely changed the behaviour.

@geowurster
Copy link
Member

geowurster commented Sep 15, 2018

Confirmed against pallets/click@035bbfa. Determining what changed.

@geowurster
Copy link
Member

pallets/click@5d1df0e changed underscores to dashes in auto-generated CLI command names. Fixed in #20. Will push a new release in #21.

@geowurster
Copy link
Member

@sebastic Thanks for catching this. I pushed a 1.0.4 release to PyPI and a tag. Shout if things are still broken.

https://github.com/click-contrib/click-plugins/releases/tag/1.0.4

@sebastic
Copy link
Author

Confirmed fixed in 1.0.4, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants