1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

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

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()