Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dvora-h committed May 6, 2024
1 parent dc28a4f commit 3b09eee
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_asyncio/test_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ async def test_lua_script(self, r):
async def test_lua_script_in_enterprise(self, r):
async with r.monitor() as m:
script = 'return redis.call("GET", "foo")'
assert await r.eval(script, 0) is None
assert await r.eval(script, 1, "foo") is None
response = await wait_for_command(r, m, "GET foo")
assert response is None
3 changes: 3 additions & 0 deletions tests/test_asyncio/test_sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
SentinelConnectionPool,
SlaveNotFoundError,
)
from tests.conftest import skip_if_redis_enterprise


@pytest_asyncio.fixture(scope="module")
Expand Down Expand Up @@ -182,6 +183,7 @@ async def test_discover_slaves(cluster, sentinel):


@pytest.mark.onlynoncluster
@skip_if_redis_enterprise()
async def test_master_for(cluster, sentinel, master_ip):
async with sentinel.master_for("mymaster", db=9) as master:
assert await master.ping()
Expand All @@ -193,6 +195,7 @@ async def test_master_for(cluster, sentinel, master_ip):


@pytest.mark.onlynoncluster
@skip_if_redis_enterprise()
async def test_slave_for(cluster, sentinel):
cluster.slaves = [
{"ip": "127.0.0.1", "port": 6379, "is_odown": False, "is_sdown": False}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ def test_lua_script(self, r):
def test_lua_script_in_enterprise(self, r):
with r.monitor() as m:
script = 'return redis.call("GET", "foo")'
assert r.eval(script, 0) is None
assert r.eval(script, 1, "foo") is None
response = wait_for_command(r, m, "GET foo")
assert response is None
4 changes: 4 additions & 0 deletions tests/test_sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
SentinelConnectionPool,
SlaveNotFoundError,
)
from tests.conftest import skip_if_redis_enterprise


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -99,6 +100,7 @@ def test_discover_master_error(sentinel):


@pytest.mark.onlynoncluster
@skip_if_redis_enterprise()
def test_dead_pool(sentinel):
master = sentinel.master_for("mymaster", db=9)
conn = master.connection_pool.get_connection("_")
Expand Down Expand Up @@ -184,6 +186,7 @@ def test_discover_slaves(cluster, sentinel):


@pytest.mark.onlynoncluster
@skip_if_redis_enterprise()
def test_master_for(cluster, sentinel, master_ip):
master = sentinel.master_for("mymaster", db=9)
assert master.ping()
Expand All @@ -195,6 +198,7 @@ def test_master_for(cluster, sentinel, master_ip):


@pytest.mark.onlynoncluster
@skip_if_redis_enterprise()
def test_slave_for(cluster, sentinel):
cluster.slaves = [
{"ip": "127.0.0.1", "port": 6379, "is_odown": False, "is_sdown": False}
Expand Down
7 changes: 6 additions & 1 deletion tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
import redis
from redis.exceptions import ConnectionError, RedisError

from .conftest import skip_if_cryptography, skip_if_nocryptography
from .conftest import (
skip_if_cryptography,
skip_if_nocryptography,
skip_if_redis_enterprise,
)
from .ssl_utils import get_ssl_filename


@pytest.mark.ssl
@skip_if_redis_enterprise()
class TestSSL:
"""Tests for SSL connections
Expand Down

0 comments on commit 3b09eee

Please sign in to comment.