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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2018-11-13.03:21:01.320>created_at=<Date2017-09-21.09:35:48.433>labels= ['3.7', 'invalid', 'type-bug', 'library']
title='Mock called_with does not ensure self/cls argument is used'updated_at=<Date2018-11-13.03:21:10.267>user='https://github.com/JonathanHuot'
mock can only verify if the function is called with the correct number of arguments as you have passed spec. It doesn't verify whether the function implementation is correct like calling Something.foobar() because it's not designed to verify the function implementation. It wouldn't raise an exception even when self.foo(1, 2) is called inside x.bar because runtime code is not executed and only the signature is checked with mock. I think this is an expected behavior and not a bug.
I agree with Karthikeyan: This is is the expected behaviour. The moment you use a mock, any implementation details are lost unless you use wraps or similar to also transfer the call to the/a real object.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: