You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suspect that this bug may have existed for a long time, since it's kind of the opposite of the issue that required the dirty hack in the first place.
The problem is that when trying to directly execute a class method (a class, not an object), Python is expecting the self argument as the first parameter to the function call.
This is because, as a language feature of Python, if you're calling the function B directly without an object then you must supply an instance. e.g.
o=A()
A.B(o) # returns 5
I'm not sure what you think the right thing to do would be in this case? One could consider the current behaviour of Sinon.PY to be correct. However, I do find it counter-intuitive (confusing) to need to pass an object instance into the stub.
The text was updated successfully, but these errors were encountered: