title: How to patch class level function calls with unittest?
body: <p>I have these code</p>
  <pre class="lang-py prettyprint-override"><code>
  class ATest(unittest.TestCase):
      start = get_start()
  
      def test_1(self):
          // Act
          // Assert
          self.assert_equal(get_start(), ...)
   
  </code></pre>
  <p>I can patch it on class level. But then only the <code>assert_equal</code> statement will be affected. The <code>ATest.start</code> will be the same.</p>
  <p>How can I make sure all the calls to <code>get_start()</code> is patched correctly.</p>
  <p>I am using <code>unittest</code>. It has setUpModule. But that doesn't work.</p>
  <p>I did this with setUpModule</p>
  <pre><code>patcher = patch('....', return_value=...)
  fake_start = None
  
  def setUpModule():
     fake_start = patcher.start()
  
  def tearDownModule():
     fake_start.stop()
  </code></pre>