File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 10
10
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
11
# License for the specific language governing permissions and limitations
12
12
# under the License.
13
+
13
14
import redis as redis
14
15
15
16
from testcontainers .core .container import DockerContainer
@@ -28,8 +29,24 @@ def _connect(self):
28
29
if not client .ping ():
29
30
raise Exception
30
31
31
- def get_client (self ):
32
- return redis .Redis (host = self .get_container_host_ip (), port = self .get_exposed_port (6379 ))
32
+ def get_client (self , ** kwargs ):
33
+ """get redis client
34
+
35
+ Parameters
36
+ ----------
37
+ kwargs: dict
38
+ Keyword arguments passed to `redis.Redis`.
39
+
40
+ Returns
41
+ -------
42
+ client: redis.Redis
43
+ Redis client to connect to the container.
44
+ """
45
+ return redis .Redis (
46
+ host = self .get_container_host_ip (),
47
+ port = self .get_exposed_port (6379 ),
48
+ ** kwargs ,
49
+ )
33
50
34
51
def start (self ):
35
52
super ().start ()
You can’t perform that action at this time.
0 commit comments