I have started to study flask using vscode text editor. So, I created some code that can be seen below:
Folders
app.py
from flask import Flask
def create_app():
app = Flask(__name__)
return app
conftest.py
from delivery.app import create_app
@pytest.fixture(scope="module")
def app():
"""Instance of Main Flask app"""
return create_app()
test_app.py
def test_app_is_created(app):
assert app.name == "delivery.app"
Ok, it is a simple example. So, when I try to run on terminal
pytest tests --fixtures
an error is returned:
ImportError while loading conftest 'D:\Projetos Dev\delivery\tests\conftest.py'.
tests\conftest.py:2: in <module>
from delivery.app import create_app
E ModuleNotFoundError: No module named 'delivery'
I don't understand why this error happens because I am trying to import a module that exists. Someone may help me to understand it?