I'm having trouble importing the modules into my project. I was creating some tests and I can not import the main from my project to test an end point, from my test file teste_ex.py
. Here is the structure of the project:
backend_api/
api/
__init__.py
main.py
testes/
__init__.py
test_ex.py
So in my test_ex.py I'm trying to import main
as follows:
import api.main
from webtest import TestApp
def test_functional_concursos_api():
app = TestApp(main.app)
assert app.get('/hello').status == '200 OK'
I only get ImportError: No module named 'api'