I have a repository with the following directory structure:
repo_folder\
----src\
----__init__.py
----src1.py
----src2.py
----src3.py
----testing\
----specific_test.py
----requirements.txt
specific_test.py
has on it's first lines:
import os
import sys
sys.path.insert(0, os.path.dirname(os.getcwd()))
import src.src1
import src.src2
import src.src3
# lots of asserts
When I run specific_test.py
from within testing
folder or from repo_folder
folder it works, but only on my local machine.
The problem is that when I try to run this from my codeship
account, it gives me an Import Error
.
The error looks like this:
ImportError
while importing test module- ERROR collecting
testing/specific_test.py
- No module named
src.src1
- Make sure your test modules/packages have valid Python names.
Do you know what would the problem be?
Do you have suggestions for better alternatives?