I'm currently working on a project whose structure is:
my_package
│ README.md
| setup.py
│
└───my_package
| | __init__.py
│ │ file1.py
│ │ file2.py
| | ...
│ └───subpackage
│ │ sub1.py
│ │ ...
│
└───test
| __init__.py
│ test_file1.py
| test_file2.py
I can run all my tests with python -m unittest discover -s test. Most of test_x.py files contain imports such as from my_package.file1 import Something. Hence, the unittest command will run all my tests against source code contained in my_package.
On the other hand, I created a private Pypi package from this package. In my CI, I would like to run my unit tests against installed files, rather than local source code.
import my_package.file1; print(my_package.file1.__file__) should then show a path to site-packages.
Is there a way to do so ?
Edit: I would like to keep my test folder separate from my_package folder as I do not intend to distribute my tests.