Skip to content

tests: dispose engines in app fixture cleanup#1419

Open
krzysdz wants to merge 1 commit intopallets-eco:mainfrom
krzysdz:tests-fix-unclosed-sqlite-db
Open

tests: dispose engines in app fixture cleanup#1419
krzysdz wants to merge 1 commit intopallets-eco:mainfrom
krzysdz:tests-fix-unclosed-sqlite-db

Conversation

@krzysdz
Copy link
Copy Markdown

@krzysdz krzysdz commented Mar 9, 2026

The problem described in #1379 is caused by a change to Python 3.13 introduced in python/cpython#105539. Calling engine.dispose() makes SQLAlchemy close all connections from the pool used by engine.

This PR fixes tests by adding cleanup to the app fixture. Honestly, I don't know if this is only a problem with tests or if it can be somehow reproduced in a real use case.

fixes #1379
closes #1380

test_metadata.py::test_reflect requires manual engine disposal, because it overwrites `app.extensions["sqlalchemy"]`
@krzysdz
Copy link
Copy Markdown
Author

krzysdz commented Mar 9, 2026

It looks like the "readthedocs" action is broken, actions/cache in the typing job needs an update and #1384 must be merged to unblock tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Test failres due to unclosed database on Python 3.13.0

1 participant