title: Determining the target for unittest.mock.patch
body: <p>I am writing a some tests for a library I've been developing. It has the following structure.</p>
  
  <pre><code>lib
  |---__init__.py
  |---mod1.py
  |---mod2.py
  |---mod3.py
  tests
  |---__init__.py
  |---test_mod1.py
  </code></pre>
  
  <p>In <strong>init</strong>.py of tests folder, I added the path of the library to the <code>sys.path</code> variable and them made all the imports. i.e. <code>from lib import mod1, mod2, mod3</code>. In <em>test_mod1.py</em> I did <code>from . import mod1</code></p>
  
  <p>The problem now is that I want to patch a function in <em>mod1.py</em>. I tried <code>mock.patch('mod1.func1')</code> but that didn't work then I tried <code>mock.patch('.mod1.func1')</code> that too is not working.
  How do I determine the target for the patch?</p>