Skip to content

Commit 13d1c07

Browse files
committed
Adding unit text fixes to improve compatibility with MacOS.
1 parent b2dd8e8 commit 13d1c07

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ services:
103103
- all
104104

105105
redis-stack:
106-
image: ${REDIS_STACK_IMAGE:-redis/redis-stack-server:edge}
106+
image: ${REDIS_STACK_IMAGE:-redis/redis-stack-server:latest}
107107
container_name: redis-stack
108108
ports:
109109
- 6479:6379
@@ -112,6 +112,7 @@ services:
112112
profiles:
113113
- standalone
114114
- all-stack
115+
- all
115116

116117
redis-stack-graph:
117118
image: redis/redis-stack-server:6.2.6-v15

tests/test_asyncio/test_connection.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import asyncio
22
import socket
33
import types
4+
import errno
45
from unittest.mock import patch
56

67
import pytest
@@ -534,7 +535,7 @@ async def test_network_connection_failure():
534535
with pytest.raises(ConnectionError) as e:
535536
redis = Redis(host="127.0.0.1", port=9999)
536537
await redis.set("a", "b")
537-
assert str(e.value).startswith("Error 111 connecting to 127.0.0.1:9999. Connect")
538+
assert str(e.value).startswith(f"Error {errno.ECONNREFUSED} connecting to 127.0.0.1:9999. Connect")
538539

539540

540541
async def test_unix_socket_connection_failure():

tests/test_connection.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import sys
55
import threading
66
import types
7+
import errno
78
from typing import Any
89
from unittest import mock
910
from unittest.mock import call, patch
@@ -352,7 +353,7 @@ def test_network_connection_failure():
352353
with pytest.raises(ConnectionError) as e:
353354
redis = Redis(port=9999)
354355
redis.set("a", "b")
355-
assert str(e.value) == "Error 111 connecting to localhost:9999. Connection refused."
356+
assert str(e.value) == f"Error {errno.ECONNREFUSED} connecting to localhost:9999. Connection refused."
356357

357358

358359
def test_unix_socket_connection_failure():

tests/test_multiprocessing.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import contextlib
22
import multiprocessing
3+
import sys
34

45
import pytest
56
import redis
@@ -8,6 +9,8 @@
89

910
from .conftest import _get_client
1011

12+
if sys.platform == "darwin":
13+
multiprocessing.set_start_method("fork", force=True)
1114

1215
@contextlib.contextmanager
1316
def exit_callback(callback, *args):

0 commit comments

Comments
 (0)