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

3 tests fail #200

Closed
yurivict opened this issue Jul 22, 2023 · 6 comments
Closed

3 tests fail #200

yurivict opened this issue Jul 22, 2023 · 6 comments

Comments

@yurivict
Copy link

========================================================================================== FAILURES ===========================================================================================
________________________________________________________________________________ test_inspect_wrapped_property ________________________________________________________________________________

    def test_inspect_wrapped_property():
        class Wrapped(object):
            def __init__(self, func):
                self.func = func
    
            def __call__(self, *args, **kwargs):
                return self.func(*args, **kwargs)
    
            @property
            def __wrapped__(self):
                return self.func
    
        func = lambda x: x
        wrapped = Wrapped(func)
        assert inspect.signature(func) == inspect.signature(wrapped)
    
>       assert num_required_args(Wrapped) is None
E       AssertionError: assert 1 is None
E        +  where 1 = num_required_args(<class 'test_inspect_args.test_inspect_wrapped_property.<locals>.Wrapped'>)

test_inspect_args.py:485: AssertionError
_______________________________________________________________________________ test_inspect_signature_property _______________________________________________________________________________

    def test_inspect_signature_property():
    
        # By adding AddX to our signature registry, we can inspect the class
        # itself and objects of the class.  `inspect.signature` doesn't like
        # it when `obj.__signature__` is a property.
        class AddX(object):
            def __init__(self, func):
                self.func = func
    
            def __call__(self, addx, *args, **kwargs):
                return addx + self.func(*args, **kwargs)
    
            @property
            def __signature__(self):
                sig = inspect.signature(self.func)
                params = list(sig.parameters.values())
                kind = inspect.Parameter.POSITIONAL_OR_KEYWORD
                newparam = inspect.Parameter('addx', kind)
                params = [newparam] + params
                return sig.replace(parameters=params)
    
        addx = AddX(lambda x: x)
        sig = inspect.signature(addx)
        assert sig == inspect.Signature(parameters=[
            inspect.Parameter('addx', inspect.Parameter.POSITIONAL_OR_KEYWORD),
            inspect.Parameter('x', inspect.Parameter.POSITIONAL_OR_KEYWORD)])
    
>       assert num_required_args(AddX) is False
E       AssertionError: assert 1 is False
E        +  where 1 = num_required_args(<class 'test_inspect_args.test_inspect_signature_property.<locals>.AddX'>)

test_inspect_args.py:463: AssertionError
_____________________________________________________________________________________ test_dev_skip_test ______________________________________________________________________________________

    def test_dev_skip_test():
        assert dev_skip_test is istest or dev_skip_test is nottest
>       assert d.get('istest', False) is True
E       AssertionError: assert False is True
E        +  where False = <built-in method get of dict object at 0x951ef0d40>('istest', False)
E        +    where <built-in method get of dict object at 0x951ef0d40> = {}.get

test_dev_skip_test.py:20: AssertionError
====================================================================================== warnings summary =======================================================================================
cytoolz/tests/test_tlz.py::test_tlz
  /usr/local/lib/python3.9/importlib/__init__.py:127: DeprecationWarning: The toolz.compatibility module is no longer needed in Python 3 and has been deprecated. Please import these utilities directly from the standard library. This module will be removed in a future release.
    return _bootstrap._gcd_import(name[level:], package, level)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================== 3 failed, 191 passed, 1 warning in 2.22s ===========================================================================

Version: 0.12.2
Python-3.9
FreeBSD 13.2

@eriknw
Copy link
Member

eriknw commented Jul 24, 2023

Oh no! These tests are passing in CI. CyToolz 0.12.2 was released to support Cython 3.0

Can you share the following:

  • toolz version
  • Cython version
  • Python interpreter (e.g., CPython, PyPy, etc)

Also, are there any logs available from this failed build?

@yurivict
Copy link
Author

toolz version: 0.12.2
cython-0.29.36
Python-3.9

@eriknw
Copy link
Member

eriknw commented Jul 24, 2023

Thanks for the report. I am unable to reproduce these errors. I ran more comprehensive tests in #201, which tests using Cython 0.29.36 and 3.0 for different OSes and Python versions.

toolz version: 0.12.2

I assume you mean 0.12.0 for toolz version. cytoolz version is 0.12.2

Python-3.9

Got it, but what's the interpreter? CPython? PyPy? Stackless-Python?

cytoolz 0.12.2 has the same functionality as 0.12.1. The only thing that changed is support for being built with Cython 3.

@yurivict
Copy link
Author

I assume you mean 0.12.0 for toolz version. cytoolz version is 0.12.2

yes, toolz-0.12.0, sorry.

Got it, but what's the interpreter? CPython? PyPy? Stackless-Python?

CPython - a default interpreter.

Here's how I can reproduce the failure from the FreeBSD port directory (git clone https://git.FreeBSD.org/ports.git /usr/ports):

cd /usr/ports/devel/py-cytoolz
make test

Now I am getting only this one failure:


    def test_dev_skip_test():
        assert dev_skip_test is istest or dev_skip_test is nottest
>       assert d.get('istest', False) is True
E       AssertionError: assert False is True
E        +  where False = <built-in method get of dict object at 0x8e4ece100>('istest', False)
E        +    where <built-in method get of dict object at 0x8e4ece100> = {}.get

test_dev_skip_test.py:20: AssertionError
====================================================================================== warnings summary =======================================================================================

@papoteur-mga
Copy link

Hello,
Building the module in Mageia Cauldron, I get also test_inspect_wrapped_property failing in the same way.
toolz 0.12.1
pytoolz 0.12.3
Python cpython 3.12.5
Cython 3.0.10

@jrbourbeau
Copy link
Member

This should be closed via #206

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