Robert <l...@posteo.de> added the comment:
According to this chapter ( https://docs.python.org/3/library/unittest.mock.html#unittest.mock.MagicMock ) the specialmethods in MagicMock are different: .return_value is preinitialized with defaultvalues, which depends on the operator. In the case of .__iter__ this is "iter([])". This is the case when running __iter__(), but not when running __iter__.result_value ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33236> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com