Closed pshirali closed 4 years ago
The following test fails with a TypeError
TypeError
def test_property_inverse(): class FooInterface(Interface): def foo(self): <--- interface defines a regular method pass with pytest.raises(NotImplementedError): @implements(FooInterface) class FooImplementationFail: @property def foo(self): <--- implementation defines a property pass
In verify_methods
cls_signature = inspect.signature(cls_method) if cls_method else None ^
With a @property decorator, a method is no longer callable. inspect.signature expects a callable. Fix: if cls_method and callable(cls_method) else None
@property
inspect.signature
if cls_method and callable(cls_method) else None
@ksindi fyi: I'll be opening issues to tag relevant commits with respective issue numbers. I'm assigning the issues to myself.
Thanks @pshirali!
The following test fails with a
TypeError
In verify_methods
With a
@property
decorator, a method is no longer callable.inspect.signature
expects a callable. Fix:if cls_method and callable(cls_method) else None