Vajrasky Kok added the comment: Okay, I found the difference.
The second test case is to test the case on which we delete the attribute of the mock instance before being referenced by any variable. The we make sure the attribute is gone for good. The first test case is to test the case on which we delete the attribute of the mock instance after being referenced by any variable (or maybe just needed to be used by __getattr__), then we make sure the attribute is resetted to the original value, not deleted. I oversight this because I never thought that people could rely on this behaviour. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18993> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com