8000 gh-105539: Emit ResourceWarning if sqlite3 database is not closed explicitly by erlend-aasland · Pull Request #108015 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-105539: Emit ResourceWarning if sqlite3 database is not closed explicitly #108015

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

Merged
merged 12 commits into from
Aug 22, 2023
Prev Previous commit
Next Next commit
Fix indent
  • Loading branch information
erlend-aasland committed Aug 17, 2023
commit d102ea024fdfdd012566ab1158e7f5ea21a09c7a
10 changes: 5 additions & 5 deletions Lib/test/test_sqlite3/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,11 +583,11 @@ def test_connect_positional_arguments(self):
cx.close()
self.assertEqual(cm.filename, __file__)

def test_connection_resource_warning(self):
with self.assertWarns(ResourceWarning):
cx = sqlite.connect(":memory:")
del cx
gc_collect()
def test_connection_resource_warning(self):
with self.assertWarns(ResourceWarning):
cx = sqlite.connect(":memory:")
del cx
gc_collect()


class UninitialisedConnectionTests(unittest.TestCase):
Expand Down
0