diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2019-07-29 15:37:31 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2019-07-29 15:37:31 -0700 |
commit | a99f389b130788724ed07b6e7534deb66fc4c52f (patch) | |
tree | 5379baf588bd3b962cd98892dac2b0d10658b34f | |
parent | f30787856749ce577078e5de12b814ea01736999 (diff) | |
download | redis-py-a99f389b130788724ed07b6e7534deb66fc4c52f.tar.gz |
use a multi-connection client for multiprocess tests
-rw-r--r-- | tests/test_multiprocessing.py | 12 |
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 |