Skip to content

Commit 561edfb

Browse files
authored
Merge pull request redis#8 from mkmkme/mkmkme/remove-old-valkey
Remove mentions and workarounds for older Redis versions
2 parents fdc01c5 + ebbc1d4 commit 561edfb

26 files changed

+37
-731
lines changed

docs/lua_scripting.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ key, multiplies it with the multiplier value and returns the result.
2626

2727
.. code:: python
2828
29-
>>> r = redis.Redis()
29+
>>> r = valkey.Valkey()
3030
>>> lua = """
3131
... local value = redis.call('GET', KEYS[1])
3232
... value = tonumber(value)
@@ -62,7 +62,7 @@ one that points to a completely different Valkey server.
6262

6363
.. code:: python
6464
65-
>>> r2 = redis.Redis('valkey2.example.com')
65+
>>> r2 = valkey.Valkey('valkey2.example.com')
6666
>>> r2.set('foo', 3)
6767
>>> multiply(keys=['foo'], args=[5], client=r2)
6868
15

tests/test_asyncio/test_cluster.py

Lines changed: 0 additions & 83 deletions
Large diffs are not rendered by default.

tests/test_asyncio/test_commands.py

Lines changed: 0 additions & 145 deletions
Large diffs are not rendered by default.

tests/test_asyncio/test_connection.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import pytest
77
import valkey
8-
from tests.conftest import skip_if_server_version_lt
98
from valkey._parsers import (
109
_AsyncHiredisParser,
1110
_AsyncRESP2Parser,
@@ -90,7 +89,6 @@ async def get_conn(_):
9089
await r.aclose()
9190

9291

93-
@skip_if_server_version_lt("4.0.0")
9492
@pytest.mark.valkeymod
9593
@pytest.mark.onlynoncluster
9694
async def test_loading_external_modules(r):

tests/test_asyncio/test_connection_pool.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import pytest
55
import pytest_asyncio
66
import valkey.asyncio as valkey
7-
from tests.conftest import skip_if_server_version_lt
87
from valkey.asyncio.connection import Connection, to_bool
98

109
from .compat import aclosing, mock
@@ -318,13 +317,11 @@ def test_port(self):
318317
assert pool.connection_class == valkey.Connection
319318
assert pool.connection_kwargs == {"host": "localhost", "port": 6380}
320319

321-
@skip_if_server_version_lt("6.0.0")
322320
def test_username(self):
323321
pool = valkey.ConnectionPool.from_url("valkey://myuser:@localhost")
324322
assert pool.connection_class == valkey.Connection
325323
assert pool.connection_kwargs == {"host": "localhost", "username": "myuser"}
326324

327-
@skip_if_server_version_lt("6.0.0")
328325
def test_quoted_username(self):
329326
pool = valkey.ConnectionPool.from_url(
330327
"valkey://%2Fmyuser%2F%2B name%3D%24+:@localhost"
@@ -350,7 +347,6 @@ def test_quoted_password(self):
350347
"password": "/mypass/+ word=$+",
351348
}
352349

353-
@skip_if_server_version_lt("6.0.0")
354350
def test_username_and_password(self):
355351
pool = valkey.ConnectionPool.from_url("valkey://myuser:mypass@localhost")
356352
assert pool.connection_class == valkey.Connection
@@ -477,13 +473,11 @@ def test_defaults(self):
477473
assert pool.connection_class == valkey.UnixDomainSocketConnection
478474
assert pool.connection_kwargs == {"path": "/socket"}
479475

480-
@skip_if_server_version_lt("6.0.0")
481476
def test_username(self):
482477
pool = valkey.ConnectionPool.from_url("unix://myuser:@/socket")
483478
assert pool.connection_class == valkey.UnixDomainSocketConnection
484479
assert pool.connection_kwargs == {"path": "/socket", "username": "myuser"}
485480

486-
@skip_if_server_version_lt("6.0.0")
487481
def test_quoted_username(self):
488482
pool = valkey.ConnectionPool.from_url(
489483
"unix://%2Fmyuser%2F%2B name%3D%24+:@/socket"
@@ -587,7 +581,6 @@ async def test_on_connect_error(self):
587581
assert not pool._available_connections[0]._reader
588582

589583
@pytest.mark.onlynoncluster
590-
@skip_if_server_version_lt("2.8.8")
591584
async def test_busy_loading_disconnects_socket(self, r):
592585
"""
593586
If Valkey raises a LOADING error, the connection should be
@@ -599,7 +592,6 @@ async def test_busy_loading_disconnects_socket(self, r):
599592
assert not r.connection._reader
600593

601594
@pytest.mark.onlynoncluster
602-
@skip_if_server_version_lt("2.8.8")
603595
async def test_busy_loading_from_pipeline_immediate_command(self, r):
604596
"""
605597
BusyLoadingErrors should raise from Pipelines that execute a
@@ -616,7 +608,6 @@ async def test_busy_loading_from_pipeline_immediate_command(self, r):
616608
assert not pool._available_connections[0]._reader
617609

618610
@pytest.mark.onlynoncluster
619-
@skip_if_server_version_lt("2.8.8")
620611
async def test_busy_loading_from_pipeline(self, r):
621612
"""
622613
BusyLoadingErrors should be raised from a pipeline execution
@@ -631,7 +622,6 @@ async def test_busy_loading_from_pipeline(self, r):
631622
assert len(pool._available_connections) == 1
632623
assert not pool._available_connections[0]._reader
633624

634-
@skip_if_server_version_lt("2.8.8")
635625
async def test_read_only_error(self, r):
636626
"""READONLY errors get turned into ReadOnlyError exceptions"""
637627
with pytest.raises(valkey.ReadOnlyError):
@@ -676,7 +666,11 @@ async def test_connect_no_auth_supplied_when_required(self, r):
676666
"""
677667
with pytest.raises(valkey.AuthenticationError):
678668
await r.execute_command(
679-
"DEBUG", "ERROR", "ERR Client sent AUTH, but no password is set"
669+
"DEBUG",
670+
"ERROR",
671+
"ERR AUTH <password> called without any password "
672+
"configured for the default user. Are you sure "
673+
"your configuration is correct?",
680674
)
681675

682676
async def test_connect_invalid_password_supplied(self, r):

tests/test_asyncio/test_pipeline.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import pytest
22
import valkey
3-
from tests.conftest import skip_if_server_version_lt
43

54
from .compat import aclosing, mock
65
from .conftest import wait_for_command
@@ -393,7 +392,6 @@ async def test_pipeline_get(self, r):
393392
assert await pipe.execute() == [b"a1"]
394393

395394
@pytest.mark.onlynoncluster
396-
@skip_if_server_version_lt("2.0.0")
397395
async def test_pipeline_discard(self, r):
398396
# empty pipeline should raise an error
399397
async with r.pipeline() as pipe:

tests/test_asyncio/test_pubsub.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import pytest
1616
import pytest_asyncio
1717
import valkey.asyncio as valkey
18-
from tests.conftest import get_protocol_version, skip_if_server_version_lt
18+
from tests.conftest import get_protocol_version
1919
from valkey.exceptions import ConnectionError
2020
from valkey.typing import EncodableT
2121
from valkey.utils import HIREDIS_AVAILABLE
@@ -608,7 +608,6 @@ async def test_channel_subscribe(self, r: valkey.Valkey):
608608
@pytest.mark.onlynoncluster
609609
class TestPubSubSubcommands:
610610
@pytest.mark.onlynoncluster
611-
@skip_if_server_version_lt("2.8.0")
612611
async def test_pubsub_channels(self, r: valkey.Valkey, pubsub):
613612
p = pubsub
614613
await p.subscribe("foo", "bar", "baz", "quux")
@@ -618,7 +617,6 @@ async def test_pubsub_channels(self, r: valkey.Valkey, pubsub):
618617
assert all([channel in await r.pubsub_channels() for channel in expected])
619618

620619
@pytest.mark.onlynoncluster
621-
@skip_if_server_version_lt("2.8.0")
622620
async def test_pubsub_numsub(self, r: valkey.Valkey):
623621
p1 = r.pubsub()
624622
await p1.subscribe("foo", "bar", "baz")
@@ -638,7 +636,6 @@ async def test_pubsub_numsub(self, r: valkey.Valkey):
638636
await p2.aclose()
639637
await p3.aclose()
640638

641-
@skip_if_server_version_lt("2.8.0")
642639
async def test_pubsub_numpat(self, r: valkey.Valkey):
643640
p = r.pubsub()
644641
await p.psubscribe("*oo", "*ar", "b*z")
@@ -650,7 +647,6 @@ async def test_pubsub_numpat(self, r: valkey.Valkey):
650647

651648
@pytest.mark.onlynoncluster
652649
class TestPubSubPings:
653-
@skip_if_server_version_lt("3.0.0")
654650
async def test_send_pubsub_ping(self, r: valkey.Valkey):
655651
p = r.pubsub(ignore_subscribe_messages=True)
656652
await p.subscribe("foo")
@@ -660,7 +656,6 @@ async def test_send_pubsub_ping(self, r: valkey.Valkey):
660656
)
661657
await p.aclose()
662658

663-
@skip_if_server_version_lt("3.0.0")
664659
async def test_send_pubsub_ping_message(self, r: valkey.Valkey):
665660
p = r.pubsub(ignore_subscribe_messages=True)
666661
await p.subscribe("foo")
@@ -673,7 +668,6 @@ async def test_send_pubsub_ping_message(self, r: valkey.Valkey):
673668

674669
@pytest.mark.onlynoncluster
675670
class TestPubSubConnectionKilled:
676-
@skip_if_server_version_lt("3.0.0")
677671
async def test_connection_error_raised_when_connection_dies(
678672
self, r: valkey.Valkey, pubsub
679673
):

tests/test_asyncio/test_scripting.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import pytest
22
import pytest_asyncio
3-
from tests.conftest import skip_if_server_version_lt
43
from valkey import exceptions
54

65
multiply_script = """
@@ -36,7 +35,6 @@ async def test_eval(self, r):
3635
assert await r.eval(multiply_script, 1, "a", 3) == 6
3736

3837
@pytest.mark.asyncio(forbid_global_loop=True)
39-
@skip_if_server_version_lt("6.2.0")
4038
async def test_script_flush(self, r):
4139
await r.set("a", 2)
4240
await r.script_load(multiply_script)

0 commit comments

Comments
 (0)