Skip to content

Commit

Permalink
Fixed ResourceWarning from unclosed SQLite connection.
Browse files Browse the repository at this point in the history
- backends.tests.ThreadTests.test_default_connection_thread_local:
    on SQLite, close() doesn't explicitly close in-memory connections.

Check out python/cpython#108015.
  • Loading branch information
felixxm committed Aug 21, 2023
1 parent bd2ff65 commit 510dd4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/backends/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,8 @@ def runner():
# 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):
Expand Down

0 comments on commit 510dd4d

Please sign in to comment.