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