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_legacy_callbacks in test_compat.py is failing in pytest 3.1+ #823

Closed
segevfiner opened this issue Jul 9, 2017 · 3 comments
Closed

Comments

@segevfiner
Copy link
Contributor

segevfiner commented Jul 9, 2017

pytest 3.1+ added https://docs.pytest.org/en/latest/warnings.html. This causes test_legacy_callbacks to fail since the warning is not printed during the test as expected. This fails in Travis CI under the Python 3.6 environment.

=================================== FAILURES ===================================
____________________________ test_legacy_callbacks _____________________________
test_compat.py:17: in test_legacy_callbacks
    assert 'Invoked legacy parameter callback' in result.output
E   AssertionError: assert 'Invoked legacy parameter callback' in 'WAT\n'
E    +  where 'WAT\n' = <Result okay>.output
=============================== warnings summary ===============================
tests/test_basic.py::test_evaluation_order
  /home/travis/build/pallets/click/click/core.py:880: Warning: Invoked legacy parameter callback "<function test_evaluation_order.<locals>.memo at 0x2b06d4955f28>".  The new signature for such callbacks starting with click 2.0 is (ctx, param, value).
    value, args = param.handle_parse_result(ctx, opts, args)

tests/test_compat.py::test_legacy_callbacks
  /home/travis/build/pallets/click/click/core.py:880: Warning: Invoked legacy parameter callback "<function test_legacy_callbacks.<locals>.legacy_callback at 0x2b06d41781e0>".  The new signature for such callbacks starting with click 2.0 is (ctx, param, value).
    value, args = param.handle_parse_result(ctx, opts, args)

tests/test_options.py::test_custom_validation
  /home/travis/build/pallets/click/click/core.py:880: Warning: Invoked legacy parameter callback "<function test_custom_validation.<locals>.validate_pos_int at 0x2b06d4196e18>".  The new signature for such callbacks starting with click 2.0 is (ctx, param, value).
    value, args = param.handle_parse_result(ctx, opts, args)

-- Docs: http://doc.pytest.org/en/latest/warnings.html
========= 1 failed, 127 passed, 1 xfailed, 3 warnings in 0.85 seconds ==========
@aviau
Copy link

aviau commented Jul 19, 2017

This also affects Debian: #868816

@FRidh
Copy link

FRidh commented Aug 25, 2017

I'm fixing Python packages for our NixOS 17.09 release, and encountered this issue. What is keeping #838 from being merged? cc @untitaker

@LokiHokie
Copy link
Contributor

Fixed

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants