Skip to content

[heads up] Test failures with Python 3.14: test_curried_operator and test_has_keywords end with an AssertionError #605

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

Open
befeleme opened this issue Mar 12, 2025 · 0 comments

Comments

@befeleme
Copy link

In Fedora Linux, we build the packages with the alpha versions of new Python and toolz test suite fails in alpha5 with the traceback below:

____________________________ test_curried_operator _____________________________

    def test_curried_operator():
        import operator
    
        for k, v in vars(cop).items():
            if not callable(v):
                continue
    
            if not isinstance(v, toolz.curry):
                try:
                    # Make sure it is unary
                    v(1)
                except TypeError:
                    try:
                        v('x')
                    except TypeError:
                        pass
                    else:
                        continue
                    raise AssertionError(
                        'toolz.curried.operator.%s is not curried!' % k,
                    )
>           assert should_curry(getattr(operator, k)) == isinstance(v, toolz.curry), k
E           AssertionError: is_none
E           assert False == True
E            +  where False = should_curry(<built-in function is_none>)
E            +    where <built-in function is_none> = getattr(<module 'operator' from '/usr/lib64/python3.14/operator.py'>, 'is_none')
E            +  and   True = isinstance(<built-in function is_none>, <class 'toolz.functoolz.curry'>)
E            +    where <class 'toolz.functoolz.curry'> = toolz.curry

toolz/tests/test_curried.py:74: AssertionError
______________________________ test_has_keywords _______________________________

    def test_has_keywords():
        assert has_keywords(lambda: None) is False
        assert has_keywords(lambda x: None) is False
        assert has_keywords(lambda x=1: None)
        assert has_keywords(lambda **kwargs: None)
        assert has_keywords(int)
        assert has_keywords(sorted)
        assert has_keywords(max)
>       assert has_keywords(map) is False
E       assert True is False
E        +  where True = has_keywords(map)

toolz/tests/test_inspect_args.py:289: AssertionError
=========================== short test summary info ============================
FAILED toolz/tests/test_curried.py::test_curried_operator - AssertionError: i...
FAILED toolz/tests/test_inspect_args.py::test_has_keywords - assert True is F...
================= 2 failed, 201 passed, 1 deselected in 1.97s ==================
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

1 participant