title: How to supply a mock class method for python unit test?
body: <p>Let's say I have a class like this.</p>
  <pre class="lang-py prettyprint-override"><code>class SomeProductionProcess(CustomCachedSingleTon):
      
      @classmethod
      def loaddata(cls):
          &quot;&quot;&quot;
          Uses an iterator over a large file in Production for the Data pipeline.
          &quot;&quot;&quot;
          pass
  </code></pre>
  <p>Now at test time I want to change the logic inside the <code>loaddata()</code> method. It would be a simple custom logic that doesn't process large data.</p>
  <p>How do we supply custom implementation of <code>loaddata()</code> at testtime using Python Mock UnitTest framework?</p>