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
Create a source file mox_restub.py, with the following contents:
importmoxclassMyClass:
defmy_function():
passm=mox.Mox()
print(MyClass.my_function) # <unbound method MyClass.my_function>m.stubout(MyClass, 'my_function')
print(MyClass.my_function) # <MockAnything instance at 139942970002032>m.stubout(MyClass, 'my_function')
print(MyClass.my_function) # <MockAnything instance at 139942970064208>m.stubout(MyClass, 'my_function')
# TypeError: Cannot Mock a MockAnything! Did you# remember to call UnsetStubs in your previous # test?
run python ./mox_restub.py
I expect an exception to be thrown at the second call to StubOutWithMock, since
MyClass.MyFunction is already a MockAnything that has not been unset with
UnsetStubs.
Instead, the second call to StubOutWithMock silently succeeds, but the third
call fails.
What version of the product are you using? On what operating system?
I expect an exception to be thrown at the second call to StubOutWithMock, since
MyClass.MyFunction is already a MockAnything that has not been unset with
UnsetStubs.
Instead, the second call to StubOutWithMock silently succeeds, but the third
call fails.
What version of the product are you using? On what operating system?
mox: python-mox 0.5.3-1ubuntu5
os: Ubuntu 12.04.1 LTS
The text was updated successfully, but these errors were encountered: