Michael Foord added the comment: Switching to Mock instead of MagicMock may help, as that doesn't have the magic proxies at all. (patch has an argument to specify which class of Mock should be used to create the mock object, MagicMock is just the default.)
Other wise using __slots__ would be fine. An alternative approach would be for MagicMock to use __getattribute__ instead of the magic proxies. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22293> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com