import pytest from app import create_app from app.extensions import db as database @pytest.fixture() def app(): application = create_app("testing") with application.app_context(): database.create_all() yield application database.session.remove() database.drop_all() @pytest.fixture() def client(app): return app.test_client() @pytest.fixture() def db(): return database