Fixed ResourceWarning from unclosed SQLite connection on Python 3.13+.

On SQLite, close() doesn't explicitly close in-memory connections.

Follow up to dd45d5223b.
This commit is contained in:
Mariusz Felisiak 2024-03-19 10:03:12 +01:00 committed by GitHub
parent 0a6ed278d8
commit 921670c694
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ class Tests(TestCase):
value = cursor.fetchone()[0]
self.assertEqual(value, 2000)
finally:
connections["default"].close()
connections["default"]._close()
@unittest.skipUnless(connection.vendor == "sqlite", "SQLite tests")
@ -321,4 +321,4 @@ class TestTransactionMode(SimpleTestCase):
try:
yield new_connection
finally:
new_connection.close()
new_connection._close()