From 921670c6943e9c532137b7d164885f2d3ab436b8 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 19 Mar 2024 10:03:12 +0100 Subject: [PATCH] Fixed ResourceWarning from unclosed SQLite connection on Python 3.13+. On SQLite, close() doesn't explicitly close in-memory connections. Follow up to dd45d5223b3c5640baefcb591782bbcff873b6bf. --- tests/backends/sqlite/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/backends/sqlite/tests.py b/tests/backends/sqlite/tests.py index 91dd83f134..109d210e54 100644 --- a/tests/backends/sqlite/tests.py +++ b/tests/backends/sqlite/tests.py @@ -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()