mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed ResourceWarning from unclosed SQLite connection on Python 3.13+.
- backends.sqlite.tests.ThreadSharing.test_database_sharing_in_threads
- backends.tests.ThreadTests.test_default_connection_thread_local:
on SQLite, close() doesn't explicitly close in-memory connections.
- servers.tests.LiveServerInMemoryDatabaseLockTest
- test_runner.tests.SQLiteInMemoryTestDbs.test_transaction_support
Check out https://github.com/python/cpython/pull/108015.
This commit is contained in:
parent
a9e0f3d301
commit
dd45d5223b
4 changed files with 40 additions and 17 deletions
|
|
@ -792,7 +792,8 @@ class ThreadTests(TransactionTestCase):
|
|||
# closed on teardown).
|
||||
for conn in connections_dict.values():
|
||||
if conn is not connection and conn.allow_thread_sharing:
|
||||
conn.close()
|
||||
conn.validate_thread_sharing()
|
||||
conn._close()
|
||||
conn.dec_thread_sharing()
|
||||
|
||||
def test_connections_thread_local(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue