title: mock.patch decorator: missing 1 required positional argument: 'self'
body: <p>I am trying to patch a variable in module <code>settings</code> during a test method run:</p>
  
  <pre><code>from unittest import mock
  
  class Test(...):
  
      @mock.patch('settings.TARGET_SCORES_PER_SECTION', True)
      def test_register_user(self):
  </code></pre>
  
  <p>I am getting this error:</p>
  
  <pre><code>ERROR: tests.test_user.transplant_class.&lt;locals&gt;.C (test_register_user)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/mock.py", line 1179, in patched
      return func(*args, **keywargs)
  TypeError: test_register_user() missing 1 required positional argument: 'self'
  </code></pre>
  
  <p>I tried different approaches, could not find a solution. </p>
  
  <p>What am I doing wrong?</p>
  
  <p>This version works just fine:</p>
  
  <pre><code>    def test_register_user(self):
          with mock.patch('settings.TARGET_SCORES_PER_SECTION', True):
              self._test_register_user()
  
      def _test_register_user(self):
  </code></pre>
  
  <p>And I was hoping the using as a <a href="https://docs.python.org/3/library/unittest.mock.html#unittest.mock.patch" rel="nofollow noreferrer">decorator</a> would work in the same way.</p>