Skip to content

Commit

Permalink
Increase test coverage for api compatible databases
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaifee committed Dec 5, 2024
1 parent 397891b commit f5ada54
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/commands/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"redis_basic_raw",
"redis_basic_resp2",
"redis_basic_raw_resp2",
"keydb",
"valkey" "redict",
)
class TestConnection:
@pytest.mark.xfail
Expand All @@ -34,7 +36,7 @@ async def test_ping(self, client, _s):
@pytest.mark.min_server_version("6.2.0")
async def test_hello_no_args(self, client, _s):
resp = await client.hello()
assert resp[_s("server")] == _s("redis")
assert resp[_s("server")] is not None

async def test_hello_extended(self, client, _s):
resp = await client.hello(client.protocol_version)
Expand Down
3 changes: 3 additions & 0 deletions tests/commands/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"redis_cluster",
"redis_cluster_blocking",
"redis_cluster_resp2",
"keydb",
"valkey",
"redict",
)
class TestServer:
async def slowlog(self, client, _s):
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,6 @@ def pytest_collection_modifyitems(items):
item.add_marker(getattr(pytest.mark, token))
elif client_name.startswith("keydb"):
item.add_marker(getattr(pytest.mark, "keydb"))
item.add_marker(getattr(pytest.mark, "xfail"))
tokens = client_name.replace("keydb_", "").split("_")

for token in tokens:
Expand Down
4 changes: 4 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
"redis_basic_raw_resp2",
"redis_ssl",
"redis_ssl_resp2",
"keydb",
"dragonfly",
"valkey",
"redict",
)
class TestClient:
@pytest.fixture(autouse=True)
Expand Down
8 changes: 7 additions & 1 deletion tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@


@targets(
"redis_basic", "redis_basic_blocking", "redis_basic_resp2", "keydb", "dragonfly"
"redis_basic",
"redis_basic_blocking",
"redis_basic_resp2",
"keydb",
"dragonfly",
"valkey",
"redict",
)
class TestPipeline:
async def test_empty_pipeline(self, client):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def make_subscribe_test_data(pubsub, encoder, type):
"redis_basic_raw_resp2",
"keydb",
"dragonfly",
"valkey",
"redict",
)
class TestPubSubSubscribeUnsubscribe:
async def _test_subscribe_unsubscribe(
Expand Down

0 comments on commit f5ada54

Please sign in to comment.