I have a problem in import of modules in my project. I was creating tests and I cant import my main to test one end point of my application, from the test file teste_ex.py
. This is my project structure:
backend_api/
api/
__init__.py
main.py
testes/
__init__.py
test_ex.py
In my test_ex.py Im trying to import main
in this way:
import api.main
from webtest import TestApp
def test_functional_concursos_api():
app = TestApp(main.app)
assert app.get('/hello').status == '200 OK'
I omly get ImportError: No module named 'api'
- What can be done to import my main to my test file?