-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-105539: Explict resource management for connection objects in sqlite3 tests #108017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-105539: Explict resource management for connection objects in sqlite3 tests #108017
Conversation
edited by bedevere-bot
- Issue: Emit resource warning if sqlite3 fails to close the database #105539
This PR either uses the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I would suggest moving memory_database() to a new utils.py
file. For me, it's surprising that tests import other tests. See for example Lib/test/test_asyncio/utils.py
.
I don't know the DB API, but I'm surprised that |
- Move test utility functions to util.py - Use memory database mixin - Add check() helper for closed connection tests - Address other remarks by Nikita
I think all your remarks are addressed now; PTAL :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
If you want, you can replace from test.test_sqlite3.util import
with from .util import
.
Thanks for the review, Victor and Nikita! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first sqlite3
PR review ✅