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

Tests fail on openSUSE Leap 15.1 Python 3 #5

Open
jayvdb opened this issue Aug 26, 2019 · 6 comments
Open

Tests fail on openSUSE Leap 15.1 Python 3 #5

jayvdb opened this issue Aug 26, 2019 · 6 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Aug 26, 2019

All of the tests are failing on openSUSE Leap Python 3 , but not on openSUSE Tumbleweed or openSUSE Leap Python 2.

This could be an issue with a specific version of click, or could be the pytest version being used. I'll dig into it, but dont want it to slip away, hence raising the issue.

...
[   12s] [130/160] cumulate python3-click-6.7-lp151.3.2
...
[   41s] ============================= test session starts ==============================
[   41s] platform linux -- Python 3.6.5, pytest-3.10.1, py-1.5.2, pluggy-0.8.0
[   41s] rootdir: /home/abuild/rpmbuild/BUILD/click-aliases-1.0.1, inifile:
[   41s] collected 9 items
[   41s] 
[   41s] tests/test_basic.py FFF
[   41s] tests/test_foobar.py FFF
[   41s] tests/test_naval.py FFF
[   41s] 
[   41s] =================================== FAILURES ===================================
[   41s] __________________________________ test_help ___________________________________
[   41s] 
[   41s] runner = <click.testing.CliRunner object at 0x7f4dc3dbbef0>
[   41s] 
[   41s]     def test_help(runner):
[   41s]         result = runner.invoke(cli)
[   41s] >       assert result.output == TEST_HELP
[   41s] E       AssertionError: assert '' == 'Usage: cli [OPTIONS] COMMAN...exit.\n\nCommands:\n  foo\n'
[   41s] E         + Usage: cli [OPTIONS] COMMAND [ARGS]...
[   41s] E         + 
[   41s] E         + Options:
[   41s] E         +   --help  Show this message and exit.
[   41s] E         + 
[   41s] E         + Commands:
[   41s] E         +   foo
[   41s] 
[   41s] tests/test_basic.py:36: AssertionError
...

https://build.opensuse.org/package/show/home:jayvdb:py-new/python-click-aliases

click-aliases-leap.log

@jayvdb
Copy link
Contributor Author

jayvdb commented Aug 26, 2019

The first step IMO would be to expand the tox matrix to include more versions of Click, esp 6.7 which is the version available on Leap 15.1

@timofurrer
Copy link
Member

The first step IMO would be to expand the tox matrix to include more versions of Click, esp 6.7 which is the version available on Leap 15.1

Sounds like the right next steps. I can do something tomorrow, but could review PRs if you'd like to work on it in the meantime.

@jayvdb
Copy link
Contributor Author

jayvdb commented Aug 26, 2019

click 6.7 is the version installed in Travis, and that doesnt seem to be the issue, as it works correctly with click 3.3+

The patch in https://build.opensuse.org/package/show/openSUSE:Leap:15.1/python-click looks concerning as it is disabling at test which looks very much like the above; same also in Leap 15.2 at
https://build.opensuse.org/package/view_file/openSUSE:Leap:15.2/python-click/python-click-test_compat.py.patch?expand=1

That suggests the test logic in click-aliases might be quite old, and the fix may be to update the test code a bit, if that doesnt break too many old versions of click.

@timofurrer
Copy link
Member

where is this patch coming from? From the openSUSE packaging? what happens without this patch applied?
The question still remains: why is it running on my/your local machine, on travis but not on your openSUSE?
What exact Python Version, click Version has this openSUSE environment?

@dvzrv
Copy link

dvzrv commented Jun 7, 2023

Trying to package this project for Arch Linux with Python 3.11 and click > 8, I am also running into this:

============================= test session starts ==============================
platform linux -- Python 3.11.3, pytest-7.3.1, pluggy-1.0.0 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /build/python-click-aliases/src/click-aliases-1.0.1
collecting ... collected 9 items

tests/test_basic.py::test_help PASSED                                    [ 11%]
tests/test_basic.py::test_foobar PASSED                                  [ 22%]
tests/test_basic.py::test_invalid FAILED                                 [ 33%]
tests/test_foobar.py::test_help PASSED                                   [ 44%]
tests/test_foobar.py::test_foobar PASSED                                 [ 55%]
tests/test_foobar.py::test_invalid FAILED                                [ 66%]
tests/test_naval.py::test_cli PASSED                                     [ 77%]
tests/test_naval.py::test_ship_help PASSED                               [ 88%]
tests/test_naval.py::test_ship_move PASSED                               [100%]

=================================== FAILURES ===================================
_________________________________ test_invalid _________________________________

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

    def test_invalid(runner):
        result = runner.invoke(cli, ['bar'])
>       assert result.output == TEST_INVALID
E       assert "Usage: cli [OPTIONS] COMMAND [ARGS]...\nTry 'cli --help' for help.\n\nError: No such command 'bar'.\n" == 'Usage: cli [OPTIONS] COMMAND [ARGS]...\nTry "cli --help" for help.\n\nError: No such command "bar".\n'
E           Usage: cli [OPTIONS] COMMAND [ARGS]...
E         - Try "cli --help" for help.
E         ?     ^          ^
E         + Try 'cli --help' for help.
E         ?     ^          ^
E
E         - Error: No such command "bar".
E         ?                        ^   ^
E         + Error: No such command 'bar'.
E         ?                        ^   ^

tests/test_basic.py:52: AssertionError
_________________________________ test_invalid _________________________________

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

    def test_invalid(runner):
        result = runner.invoke(cli, ['baz'])
>       assert result.output == TEST_INVALID
E       assert "Usage: cli [OPTIONS] COMMAND [ARGS]...\nTry 'cli --help' for help.\n\nError: No such command 'baz'.\n" == 'Usage: cli [OPTIONS] COMMAND [ARGS]...\nTry "cli --help" for help.\n\nError: No such command "baz".\n'
E           Usage: cli [OPTIONS] COMMAND [ARGS]...
E         - Try "cli --help" for help.
E         ?     ^          ^
E         + Try 'cli --help' for help.
E         ?     ^          ^
E
E         - Error: No such command "baz".
E         ?                        ^   ^
E         + Error: No such command 'baz'.
E         ?                        ^   ^

tests/test_foobar.py:53: AssertionError
=========================== short test summary info ============================
FAILED tests/test_basic.py::test_invalid - assert "Usage: cli [OPTIONS] COMMA...
FAILED tests/test_foobar.py::test_invalid - assert "Usage: cli [OPTIONS] COMM...
========================= 2 failed, 7 passed in 0.04s ==========================

In case this is already fixed, can a new release please be made?

@tuxmaster5000
Copy link

using click 8.1.3 under Fedora, the tests fails with:

+ /usr/bin/python3 -m tox --current-env -q --recreate -e py311
============================= test session starts ==============================
platform linux -- Python 3.11.3, pytest-7.1.3, pluggy-1.0.0
cachedir: .tox/py311/.pytest_cache
rootdir: /builddir/build/BUILD/click-aliases-1.0.1
collected 9 items

tests/test_basic.py ..F                                                  [ 33%]
tests/test_foobar.py ..F                                                 [ 66%]
tests/test_naval.py ...                                                  [100%]

=================================== FAILURES ===================================
_________________________________ test_invalid _________________________________

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

    def test_invalid(runner):
        result = runner.invoke(cli, ['bar'])
>       assert result.output == TEST_INVALID
E       assert "Usage: cli [...mand 'bar'.\n" == 'Usage: cli [...mand "bar".\n'
E         Skipping 33 identical leading characters in diff, use -v to show
E           S]...
E         - Try "cli --help" for help.
E         ?     ^          ^
E         + Try 'cli --help' for help.
E         ?     ^          ^
E           ...
E         
E         ...Full output truncated (5 lines hidden), use '-vv' to show

tests/test_basic.py:52: AssertionError
_________________________________ test_invalid _________________________________

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

    def test_invalid(runner):
        result = runner.invoke(cli, ['baz'])
>       assert result.output == TEST_INVALID
E       assert "Usage: cli [...mand 'baz'.\n" == 'Usage: cli [...mand "baz".\n'
E         Skipping 33 identical leading characters in diff, use -v to show
E           S]...
E         - Try "cli --help" for help.
E         ?     ^          ^
E         + Try 'cli --help' for help.
E         ?     ^          ^
E           ...
E         
E         ...Full output truncated (5 lines hidden), use '-vv' to show

tests/test_foobar.py:53: AssertionError
=========================== short test summary info ============================
FAILED tests/test_basic.py::test_invalid - assert "Usage: cli [...mand 'bar'....
FAILED tests/test_foobar.py::test_invalid - assert "Usage: cli [...mand 'baz'...
========================= 2 failed, 7 passed in 0.07s ==========================
ERROR: InvocationError for command /usr/bin/py.test (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   py311: commands failed

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

4 participants