diff options
Diffstat (limited to 'tests/test_multiprocessing.py')
-rw-r--r-- | tests/test_multiprocessing.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/test_multiprocessing.py b/tests/test_multiprocessing.py index 2d27c4e..d0feef1 100644 --- a/tests/test_multiprocessing.py +++ b/tests/test_multiprocessing.py @@ -35,7 +35,7 @@ class TestMultiprocessing: A connection owned by a parent and closed by a child doesn't destroy the file descriptors so a parent can still use it. """ - conn = Connection(host=master_host) + conn = Connection(host=master_host[0], port=master_host[1]) conn.send_command('ping') assert conn.read_response() == b'PONG' @@ -61,7 +61,7 @@ class TestMultiprocessing: A connection owned by a parent is unusable by a child if the parent (the owning process) closes the connection. """ - conn = Connection(host=master_host) + conn = Connection(host=master_host[0], port=master_host[1]) conn.send_command('ping') assert conn.read_response() == b'PONG' @@ -89,7 +89,9 @@ class TestMultiprocessing: A child will create its own connections when using a pool created by a parent. """ - pool = ConnectionPool.from_url('redis://{}'.format(master_host), + pool = ConnectionPool.from_url('redis://{}:{}'.format(master_host[0], + master_host[1], + ), max_connections=max_connections) conn = pool.get_connection('ping') @@ -124,7 +126,8 @@ class TestMultiprocessing: A child process that uses the same pool as its parent isn't affected when the parent disconnects all connections within the pool. """ - pool = ConnectionPool.from_url('redis://{}'.format(master_host), + pool = ConnectionPool.from_url('redis://{}:{}'.format(master_host[0], + master_host[1]), max_connections=max_connections) conn = pool.get_connection('ping') |