[issue36848] autospec fails with AttributeError when mocked class has __signature__ non-writeable

2019-06-06 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: The jira issue in pyside2 is closed as fixed. I am closing this as third party. -- resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker

[issue36848] autospec fails with AttributeError when mocked class has __signature__ non-writeable

2019-05-08 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Okay, I opened a bug in pyside tracker : https://bugreports.qt.io/browse/PYSIDE-1004 -- ___ Python tracker ___ ___

[issue36848] autospec fails with AttributeError when mocked class has __signature__ non-writeable

2019-05-08 Thread Chris Withers
Chris Withers added the comment: We only attempt to set __signature__ on Mocks, so I don't think extensions will be a problem. I do think there's a bit of code smell on that method: it's called _check_* and then changes some attributes, that might be worth fixing? -- __

[issue36848] autospec fails with AttributeError when mocked class has __signature__ non-writeable

2019-05-08 Thread Mario Corchero
Mario Corchero added the comment: Agree, for the general case I think it makes sense that this is fixed in pyside. Hijacking __signature__ python-wide sounds like it can cause other issues, if they need such a hack I would suggest finding a way (in pyside) to allow for mock to work. I wonder

[issue36848] autospec fails with AttributeError when mocked class has __signature__ non-writeable

2019-05-08 Thread Chris Withers
Chris Withers added the comment: I'm not sure we should try and work around this; hijacking __signature__ python-wide is going to cause a bunch of other problems. My vote would be to just open a bug on the pyside tracker (wherever that is) and close the issue and and on the backport by point

[issue36848] autospec fails with AttributeError when mocked class has __signature__ non-writeable

2019-05-08 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > Wow, is this just an issue that the pyside guys need to fix? I guess so. PySide __init__.py has "import shiboken" which also does type.__signature__. It seems like shiboken is some kind of generator to generate Python bindings from C++ QT code. I

[issue36848] autospec fails with AttributeError when mocked class has __signature__ non-writeable

2019-05-08 Thread Chris Withers
Chris Withers added the comment: Wow, is this just an issue that the pyside guys need to fix? -- ___ Python tracker ___ ___ Python-

[issue36848] autospec fails with AttributeError when mocked class has __signature__ non-writeable

2019-05-08 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: As noted in https://github.com/testing-cabal/mock/issues/464#issuecomment-490381389 just importing PySide2 makes __signature__ not writeable for any class defined after the import. $ python Python 3.8.0a4+ (heads/master:b1c3167c23, May 8 2019, 05

[issue36848] autospec fails with AttributeError when mocked class has __signature__ non-writeable

2019-05-07 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : With issue17185 __signature__ was set so that inspect can use this to return signature for mock objects. But in PySide2 it has __signature__ set as a non-writeable property and hence trying to set __signature__ fails. It's actually setting __sign