From 302caa40e4caab7d95ef7d0a88a90f935039ab09 Mon Sep 17 00:00:00 2001 From: Martin Thoma Date: Thu, 24 Sep 2020 18:37:55 +0200 Subject: Made small readability improvements. --- tests/backends/tests.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'tests/backends') diff --git a/tests/backends/tests.py b/tests/backends/tests.py index cf6bdbf25d..ed1847ede5 100644 --- a/tests/backends/tests.py +++ b/tests/backends/tests.py @@ -665,10 +665,9 @@ class ThreadTests(TransactionTestCase): # (the connection opened in the main thread will automatically be # closed on teardown). for conn in connections_dict.values(): - if conn is not connection: - if conn.allow_thread_sharing: - conn.close() - conn.dec_thread_sharing() + if conn is not connection and conn.allow_thread_sharing: + conn.close() + conn.dec_thread_sharing() def test_connections_thread_local(self): """ @@ -702,10 +701,9 @@ class ThreadTests(TransactionTestCase): # (the connection opened in the main thread will automatically be # closed on teardown). for conn in connections_dict.values(): - if conn is not connection: - if conn.allow_thread_sharing: - conn.close() - conn.dec_thread_sharing() + if conn is not connection and conn.allow_thread_sharing: + conn.close() + conn.dec_thread_sharing() def test_pass_connection_between_threads(self): """ -- cgit v1.3