-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Looks like there has been a new major release for flask-sqlalchemy https://flask-sqlalchemy.palletsprojects.com/en/3.0.x/changes/#version-3-0-0 and they have broken backwards compatibility in a few places.
For example :
@pytest.fixture(scope='function')
def _transaction(request, _db, mocker):
'''
Create a transactional context for tests to run in.
'''
# Start a transaction
> connection = _db.engine.connect()
../../../.cache/pypoetry/virtualenvs/api-S2mtXI53-py3.8/lib/python3.8/site-packages/pytest_flask_sqlalchemy/fixtures.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.cache/pypoetry/virtualenvs/api-S2mtXI53-py3.8/lib/python3.8/site-packages/flask_sqlalchemy/extension.py:642: in engine
return self.engines[None]
../../../.cache/pypoetry/virtualenvs/api-S2mtXI53-py3.8/lib/python3.8/site-packages/flask_sqlalchemy/extension.py:628: in engines
app = current_app._get_current_object() # type: ignore[attr-defined]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _get_current_object() -> T:
try:
obj = local.get() # type: ignore[union-attr]
except LookupError:
> raise RuntimeError(unbound_message) from None
E RuntimeError: Working outside of application context.
E
Also the create_scoped_session
method seems to have gone.
stevanmilic, ruimelodev, ddorian, devinbarry, cbradl01 and 12 more
Metadata
Metadata
Assignees
Labels
No labels