title: Mocking class method with pytest-mock returns error
body: <p>I'm trying to mock a class method with pytest-mock. I have the code below in a single file, and when the test is run I get <code>ModuleNotFoundError: No module named 'RealClass'</code> in the <code>patch</code> function. How to make this work?</p>
  <pre><code>class RealClass:
      def some_function():
          return 'real'
      
  def function_to_test():
      x = RealClass()
      return x.some_function()
  
  def test_the_function(mocker):
  
      mock_function = mocker.patch('RealClass.some_function')
      mock_function.return_value = 'mocked'
  
      ret = function_to_test()
      assert ret == 'mocked'
  </code></pre>