diff options
| author | Andy McCurdy <andy@andymccurdy.com> | 2019-01-27 12:15:20 -0800 |
|---|---|---|
| committer | Andy McCurdy <andy@andymccurdy.com> | 2019-01-27 12:15:20 -0800 |
| commit | 04ddd34ec55a659b5bb8c1ac8c47899781b90a6d (patch) | |
| tree | e2f22228468576a51f1b66d0d70ab0f8563e0b25 | |
| parent | ee5fe7e80d73b4637026c32c6760881b32a8234f (diff) | |
| download | redis-py-04ddd34ec55a659b5bb8c1ac8c47899781b90a6d.tar.gz | |
the fix to TimeoutErrors had a side affect on test teardowns
| -rw-r--r-- | CHANGES | 4 | ||||
| -rw-r--r-- | tests/conftest.py | 7 |
2 files changed, 8 insertions, 3 deletions
@@ -1,6 +1,6 @@ * 3.1.0 (in development) - * Fixed an issue with retry_on_timeout logic that caused some TimedOut - errors to be retried. Thanks Aaron Yang. #1022/#1023 + * Fixed an issue with retry_on_timeout logic that caused some TimeoutErrors + to be retried. Thanks Aaron Yang. #1022/#1023 * Added support for SNI for SSL. Thanks @oridistor and Roey Prat. #1087 * Fixed ConnectionPool repr for pools with no connections. Thanks Cody Scott. #1043/#995 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 |
