summaryrefslogtreecommitdiff
path: root/dev-python/litestar/files/litestar-2.19.0-no-valkey.patch
blob: c788e3962bc4c1fae13f46980421fdf9b7d25e7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
diff --git a/tests/conftest.py b/tests/conftest.py
index 846899814..9f0df8bc1 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -18,8 +18,6 @@ from pytest_lazy_fixtures import lf
 from redis.asyncio import Redis as AsyncRedis
 from redis.client import Redis
 from time_machine import Coordinates, travel
-from valkey.asyncio import Valkey as AsyncValkey
-from valkey.client import Valkey
 
 from litestar.logging import LoggingConfig
 from litestar.middleware.session import SessionMiddleware
@@ -31,7 +29,6 @@ from litestar.stores.base import Store
 from litestar.stores.file import FileStore
 from litestar.stores.memory import MemoryStore
 from litestar.stores.redis import RedisStore
-from litestar.stores.valkey import ValkeyStore
 from litestar.testing import RequestFactory
 from tests.helpers import not_none
 
@@ -85,11 +82,6 @@ def redis_store(redis_client: AsyncRedis) -> RedisStore:
     return RedisStore(redis=redis_client)
 
 
-@pytest.fixture()
-def valkey_store(valkey_client: AsyncValkey) -> ValkeyStore:
-    return ValkeyStore(valkey=valkey_client)
-
-
 @pytest.fixture()
 def memory_store() -> MemoryStore:
     return MemoryStore()
@@ -115,7 +107,6 @@ def file_store_create_directories_flag_false(tmp_path: Path) -> FileStore:
 @pytest.fixture(
     params=[
         pytest.param("redis_store", marks=pytest.mark.xdist_group("redis")),
-        pytest.param("valkey_store", marks=pytest.mark.xdist_group("valkey")),
         "memory_store",
         "file_store",
     ]
@@ -341,20 +332,6 @@ async def redis_client(docker_ip: str, redis_service: None) -> AsyncGenerator[As
         pass
 
 
-@pytest.fixture()
-async def valkey_client(docker_ip: str, valkey_service: None) -> AsyncGenerator[AsyncValkey, None]:
-    # this is to get around some weirdness with pytest-asyncio and valkey interaction
-    # on 3.8 and 3.9
-
-    Valkey(host=docker_ip, port=6381).flushall()
-    client: AsyncValkey = AsyncValkey(host=docker_ip, port=6381)
-    yield client
-    try:
-        await client.aclose()
-    except RuntimeError:
-        pass
-
-
 @pytest.fixture(autouse=True)
 def _patch_openapi_config(monkeypatch: pytest.MonkeyPatch) -> None:
     monkeypatch.setattr("litestar.app.DEFAULT_OPENAPI_CONFIG", OpenAPIConfig(title="Litestar API", version="1.0.0"))
diff --git a/tests/docker_service_fixtures.py b/tests/docker_service_fixtures.py
index 84e78d48e..6efca3697 100644
--- a/tests/docker_service_fixtures.py
+++ b/tests/docker_service_fixtures.py
@@ -13,8 +13,6 @@ import asyncpg
 import pytest
 from redis.asyncio import Redis as AsyncRedis
 from redis.exceptions import ConnectionError as RedisConnectionError
-from valkey.asyncio import Valkey as AsyncValkey
-from valkey.exceptions import ConnectionError as ValkeyConnectionError
 
 from litestar.utils import ensure_async_callable
 
@@ -129,21 +127,6 @@ async def redis_service(docker_services: DockerServiceRegistry) -> None:
     await docker_services.start("redis", check=redis_responsive)
 
 
-async def valkey_responsive(host: str) -> bool:
-    client: AsyncValkey = AsyncValkey(host=host, port=6381)
-    try:
-        return await client.ping()
-    except (ConnectionError, ValkeyConnectionError):
-        return False
-    finally:
-        await client.aclose()
-
-
-@pytest.fixture()
-async def valkey_service(docker_services: DockerServiceRegistry) -> None:
-    await docker_services.start("valkey", check=valkey_responsive)
-
-
 async def postgres_responsive(host: str) -> bool:
     try:
         conn = await asyncpg.connect(