1
I’m having trouble importing the modules into my project. I was creating some tests and I can’t import the main of my project to test an end point from my test file teste_ex.py
. Follows 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 to 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 just get ImportError: No module named 'api'
That would be creating a Unit and importing into it?
– Marlysson
If by "Unit" you mean "an uninstalled module," I believe so.
– Rui Lima