File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 2
2
import multiprocessing
3
3
import contextlib
4
4
5
+ import redis
5
6
from redis .connection import Connection , ConnectionPool
6
7
from redis .exceptions import ConnectionError
7
8
9
+ from .conftest import _get_client
10
+
8
11
9
12
@contextlib .contextmanager
10
13
def exit_callback (callback , * args ):
@@ -18,6 +21,15 @@ class TestMultiprocessing(object):
18
21
# Test connection sharing between forks.
19
22
# See issue #1085 for details.
20
23
24
+ # use a multi-connection client as that's the only type that is
25
+ # actuall fork/process-safe
26
+ @pytest .fixture ()
27
+ def r (self , request ):
28
+ return _get_client (
29
+ redis .Redis ,
30
+ request = request ,
31
+ single_connection_client = False )
32
+
21
33
def test_close_connection_in_child (self ):
22
34
"""
23
35
A connection owned by a parent and closed by a child doesn't
You can’t perform that action at this time.
0 commit comments