Skip to content

test_inspect_wrapped_property fails #577

Closed
@doronbehar

Description

@doronbehar

In a batch of python updates to NixOS, we experienced this error:

=================================== 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'>)

toolz/tests/test_inspect_args.py:485: AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions