import pytest


@pytest.fixture(scope='module')
def app():
    from api import app
    return app

import pytest


@pytest.fixture(scope='module')
def app():
    from api import app, db

    app.config['TESTING'] = True
    db.create_all()

    return app

Fix default fixture to initialize database
Fix default fixture to initialize database
