New submission from Michael Foord: >>> from unittest.mock import create_autospec >>> def f(): pass ... >>> m = create_autospec(f) >>> m.side_effect = [1, 2] >>> m() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<string>", line 3, in f File "/compile/py3k-cpython/Lib/unittest/mock.py", line 872, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/compile/py3k-cpython/Lib/unittest/mock.py", line 931, in _mock_call result = next(effect) TypeError: 'list' object is not an iterator
---------- assignee: michael.foord components: Library (Lib) messages: 187692 nosy: michael.foord priority: normal severity: normal stage: needs patch status: open title: Setting a side_effect on mock from create_autospec doesn't work type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17826> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com