summaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2019-01-27 12:15:20 -0800
committerAndy McCurdy <andy@andymccurdy.com>2019-01-27 12:15:20 -0800
commit04ddd34ec55a659b5bb8c1ac8c47899781b90a6d (patch)
treee2f22228468576a51f1b66d0d70ab0f8563e0b25 /tests/conftest.py
parentee5fe7e80d73b4637026c32c6760881b32a8234f (diff)
downloadredis-py-04ddd34ec55a659b5bb8c1ac8c47899781b90a6d.tar.gz
the fix to TimeoutErrors had a side affect on test teardowns
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 6e046f2..b5d0762 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -26,7 +26,12 @@ def _get_client(cls, request=None, **kwargs):
client.flushdb()
if request:
def teardown():
- client.flushdb()
+ try:
+ client.flushdb()
+ except redis.ConnectionError:
+ # handle cases where a test disconnected a client
+ # just manually retry the flushdb
+ client.flushdb()
client.connection_pool.disconnect()
request.addfinalizer(teardown)
return client