import os os.environ["DATABASE_URL"] = "sqlite:///test.db" import pytest from app import create_app from app.database import Base, engine @pytest.fixture def client(): app = create_app() app.config["TESTING"] = True Base.metadata.create_all(bind=engine) with app.test_client() as client: yield client Base.metadata.drop_all(bind=engine)