Closed dwreeves closed 1 year ago
Oh no... so apparently I was calling _db
with a live application context in my test suite, which is why I didn't identify another regression, which is that SQLAlchemy 3.0 requires the app context to work. I'm closing for now. Fixing this would likely require some sort of breaking change to pytest-flask-sqlalchemy
.
In the latest version of Flask-SQLAlchemy, the method
SQLAlchemy.create_scoped_session
was renamed toSQLAlchemy._make_scoped_session
, which causes a regression. I've added handling for this regression. I've also updated the workflows to test against Flask-SQLAlchemy 2 and 3.I confirmed that this fix works by making the modification in a
venv/
in which I am usingpytest-flask-sqlalchemy
and then running my tests with the changes.