title: mock patch not work with nosetests
body: <p>I just tried to learn the <a href="https://pypi.python.org/pypi/mock" rel="nofollow">mock</a> and <a href="https://nose.readthedocs.org/en/latest/" rel="nofollow">nosetests</a> by running simple examples, but got no luck:</p>
  
  <pre><code>john$ nosetests test_mylib.py
  E
  ======================================================================
  ERROR: test_mylib.test_mylib_foo
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/Users/wjq/py-virtenv-2.7.5/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
      self.test(*self.arg)
    File "/Users/wjq/py-virtenv-2.7.5/lib/python2.7/site-packages/mock.py", line 1201, in patched
      return func(*args, **keywargs)
  TypeError: test_mylib_foo() takes exactly 2 arguments (1 given)
  </code></pre>
  
  <p>However if I run the test directly, it's ok:</p>
  
  <pre><code>john$ python test_mylib.py
  john$ 
  </code></pre>
  
  <p>I think I must miss some key understanding on the tow libraries since I'm new to them. Really appreciate if someone can point them out.</p>
  
  <p>The followings are my example codes.</p>
  
  <p>test_mylib.py</p>
  
  <pre class="lang-py prettyprint-override"><code>import mock
  import mylib
  
  @mock.patch('mylib.incr')
  def test_mylib_foo(aa, incr):
      incr.return_value=5
      assert mylib.foo(1) == 6
  
  if __name__ == '__main__':
      test_mylib_foo(123)
  </code></pre>
  
  
  
  <p>mylib.py
  </p>
  
  <pre><code>from depen import incr
  def foo(aa):
      return incr(aa) +1
  </code></pre>
  
  
  
  <p>depen.py</p>
  
  <pre class="lang-py prettyprint-override"><code>def incr(aa):
      return aa+1
  </code></pre>