summaryrefslogtreecommitdiff
path: root/tests/backends
diff options
context:
space:
mode:
authorMartin Thoma <info@martin-thoma.de>2020-09-24 18:37:55 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-10-28 20:20:20 +0100
commit302caa40e4caab7d95ef7d0a88a90f935039ab09 (patch)
tree5508daa6533f00834203e2d38e1f02919f513636 /tests/backends
parent4eb756793b64cf153be4fbe0411da6e3e4f1279d (diff)
Made small readability improvements.
Diffstat (limited to 'tests/backends')
-rw-r--r--tests/backends/tests.py14
1 files changed, 6 insertions, 8 deletions
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):
"""