title: Can a mock side_effect iterator be reset after it has been exhausted?
body: <p><code>mock.reset_mock()</code> will not reset a side effect iterator.  Is there a way to do this without creating the mock again?</p>
  
  <pre><code>&gt;&gt;&gt; from mock import MagicMock
  &gt;&gt;&gt; mock = MagicMock(side_effect = [1,2])
  &gt;&gt;&gt; mock(), mock()
  (1, 2)
  &gt;&gt;&gt; mock()
  
  Traceback (most recent call last):
    File "&lt;pyshell#114&gt;", line 1, in &lt;module&gt;
      mock()
    File "C:\Python27\Lib\site-packages\mock.py", line 955, in __call__
      return _mock_self._mock_call(*args, **kwargs)
    File "C:\Python27\Lib\site-packages\mock.py", line 1013, in _mock_call
      result = next(effect)
  StopIteration
  &gt;&gt;&gt; mock.reset_mock()
  &gt;&gt;&gt; mock()
  
  Traceback (most recent call last):
    ...
  StopIteration
  &gt;&gt;&gt; mock = MagicMock(side_effect = [1,2])
  &gt;&gt;&gt; mock(), mock()
  (1, 2)
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>The intent is to re-use the mock in subsequent tests but I suspect that, like a generator, it cannot be <em>restarted</em>.</p>
  
  <p>So (better late than never) after being pointed in the right direction I looked in <code>mock.py</code> and found that <code>side_effect</code> is an iterator object (which cannot be <em>reset</em> once exhausted):</p>
  
  <pre><code>def __set_side_effect(self, value):
      value = _try_iter(value)
      ...
  
  def _try_iter(obj):
      ...
      try:
          return iter(obj)
      except TypeError:
          # XXXX backwards compatibility
          # but this will blow up on first call - so maybe we should fail early?
          return obj
  </code></pre>
  
  <p>and <code>def reset_mock()</code>  does not address the side efect.</p>