Skip to content

Commit fec8e32

Browse files
committed
fix tests
1 parent 0bcd574 commit fec8e32

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tests/test_asyncio/test_cache.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest_asyncio
55
from redis._cache import _LocalCache
66
from redis.utils import HIREDIS_AVAILABLE
7+
from tests.conftest import skip_if_server_version_lt
78

89

910
@pytest_asyncio.fixture
@@ -15,6 +16,7 @@ async def r(request, create_redis):
1516

1617

1718
@pytest.mark.skipif(HIREDIS_AVAILABLE, reason="PythonParser only")
19+
@skip_if_server_version_lt("7.4.0")
1820
class TestLocalCache:
1921
@pytest.mark.onlynoncluster
2022
@pytest.mark.parametrize("r", [{"cache": _LocalCache()}], indirect=True)
@@ -187,6 +189,7 @@ async def test_csc_not_cause_disconnects(self, r):
187189

188190
@pytest.mark.skipif(HIREDIS_AVAILABLE, reason="PythonParser only")
189191
@pytest.mark.onlycluster
192+
@skip_if_server_version_lt("7.4.0")
190193
class TestClusterLocalCache:
191194
@pytest.mark.parametrize("r", [{"cache": _LocalCache()}], indirect=True)
192195
async def test_get_from_cache(self, r, r2):

tests/test_cache.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import redis
55
from redis._cache import _LocalCache
66
from redis.utils import HIREDIS_AVAILABLE
7-
from tests.conftest import _get_client
7+
from tests.conftest import _get_client, skip_if_server_version_lt
88

99

1010
@pytest.fixture()
@@ -19,6 +19,7 @@ def r(request):
1919

2020

2121
@pytest.mark.skipif(HIREDIS_AVAILABLE, reason="PythonParser only")
22+
@skip_if_server_version_lt("7.4.0")
2223
class TestLocalCache:
2324
@pytest.mark.onlynoncluster
2425
@pytest.mark.parametrize("r", [{"cache": _LocalCache()}], indirect=True)
@@ -192,6 +193,7 @@ def test_csc_not_cause_disconnects(self, r):
192193

193194
@pytest.mark.skipif(HIREDIS_AVAILABLE, reason="PythonParser only")
194195
@pytest.mark.onlycluster
196+
@skip_if_server_version_lt("7.4.0")
195197
class TestClusterLocalCache:
196198
@pytest.mark.parametrize("r", [{"cache": _LocalCache()}], indirect=True)
197199
def test_get_from_cache(self, r, r2):

0 commit comments

Comments
 (0)