summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_multiprocessing.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_multiprocessing.py b/tests/test_multiprocessing.py
index bb31a06..17bdcc2 100644
--- a/tests/test_multiprocessing.py
+++ b/tests/test_multiprocessing.py
@@ -2,9 +2,12 @@ import pytest
import multiprocessing
import contextlib
+import redis
from redis.connection import Connection, ConnectionPool
from redis.exceptions import ConnectionError
+from .conftest import _get_client
+
@contextlib.contextmanager
def exit_callback(callback, *args):
@@ -18,6 +21,15 @@ class TestMultiprocessing(object):
# Test connection sharing between forks.
# See issue #1085 for details.
+ # use a multi-connection client as that's the only type that is
+ # actuall fork/process-safe
+ @pytest.fixture()
+ def r(self, request):
+ return _get_client(
+ redis.Redis,
+ request=request,
+ single_connection_client=False)
+
def test_close_connection_in_child(self):
"""
A connection owned by a parent and closed by a child doesn't