Skip to content

Commit 56b2a54

Browse files
authored
BUG: fix missing redis_url fixture in integration tests (#249)
1 parent b954656 commit 56b2a54

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ docs/_build/
1111
.venv
1212
.env
1313
coverage.xml
14-
dist/
14+
dist/
15+
.vscode/settings.json

tests/integration/test_llmcache.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -868,13 +868,19 @@ def test_create_cache_with_different_vector_types():
868868
pytest.skip("Not using a late enough version of Redis")
869869

870870

871-
def test_bad_dtype_connecting_to_existing_cache():
871+
def test_bad_dtype_connecting_to_existing_cache(redis_url):
872872
try:
873-
cache = SemanticCache(name="float64_cache", dtype="float64")
874-
same_type = SemanticCache(name="float64_cache", dtype="float64")
873+
cache = SemanticCache(
874+
name="float64_cache", dtype="float64", redis_url=redis_url
875+
)
876+
same_type = SemanticCache(
877+
name="float64_cache", dtype="float64", redis_url=redis_url
878+
)
875879
# under the hood uses from_existing
876880
except RedisModuleVersionError:
877881
pytest.skip("Not using a late enough version of Redis")
878882

879883
with pytest.raises(ValueError):
880-
bad_type = SemanticCache(name="float64_cache", dtype="float16")
884+
bad_type = SemanticCache(
885+
name="float64_cache", dtype="float16", redis_url=redis_url
886+
)

tests/integration/test_semantic_router.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -241,30 +241,34 @@ def test_bad_connection_info(routes):
241241
)
242242

243243

244-
def test_different_vector_dtypes(routes):
244+
def test_different_vector_dtypes(redis_url, routes):
245245
try:
246246
bfloat_router = SemanticRouter(
247247
name="bfloat_router",
248248
routes=routes,
249249
dtype="bfloat16",
250+
redis_url=redis_url,
250251
)
251252

252253
float16_router = SemanticRouter(
253254
name="float16_router",
254255
routes=routes,
255256
dtype="float16",
257+
redis_url=redis_url,
256258
)
257259

258260
float32_router = SemanticRouter(
259261
name="float32_router",
260262
routes=routes,
261263
dtype="float32",
264+
redis_url=redis_url,
262265
)
263266

264267
float64_router = SemanticRouter(
265268
name="float64_router",
266269
routes=routes,
267270
dtype="float64",
271+
redis_url=redis_url,
268272
)
269273

270274
for router in [bfloat_router, float16_router, float32_router, float64_router]:
@@ -273,18 +277,20 @@ def test_different_vector_dtypes(routes):
273277
pytest.skip("Not using a late enough version of Redis")
274278

275279

276-
def test_bad_dtype_connecting_to_exiting_router(routes):
280+
def test_bad_dtype_connecting_to_exiting_router(redis_url, routes):
277281
try:
278282
router = SemanticRouter(
279283
name="float64 router",
280284
routes=routes,
281285
dtype="float64",
286+
redis_url=redis_url,
282287
)
283288

284289
same_type = SemanticRouter(
285290
name="float64 router",
286291
routes=routes,
287292
dtype="float64",
293+
redis_url=redis_url,
288294
)
289295
# under the hood uses from_existing
290296
except RedisModuleVersionError:
@@ -295,4 +301,5 @@ def test_bad_dtype_connecting_to_exiting_router(routes):
295301
name="float64 router",
296302
routes=routes,
297303
dtype="float16",
304+
redis_url=redis_url,
298305
)

tests/integration/test_session_manager.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,19 @@ def test_different_vector_dtypes():
563563
pytest.skip("Not using a late enough version of Redis")
564564

565565

566-
def test_bad_dtype_connecting_to_exiting_session():
566+
def test_bad_dtype_connecting_to_exiting_session(redis_url):
567567
try:
568-
session = SemanticSessionManager(name="float64 session", dtype="float64")
569-
same_type = SemanticSessionManager(name="float64 session", dtype="float64")
568+
session = SemanticSessionManager(
569+
name="float64 session", dtype="float64", redis_url=redis_url
570+
)
571+
same_type = SemanticSessionManager(
572+
name="float64 session", dtype="float64", redis_url=redis_url
573+
)
570574
# under the hood uses from_existing
571575
except RedisModuleVersionError:
572576
pytest.skip("Not using a late enough version of Redis")
573577

574578
with pytest.raises(ValueError):
575-
bad_type = SemanticSessionManager(name="float64 session", dtype="float16")
579+
bad_type = SemanticSessionManager(
580+
name="float64 session", dtype="float16", redis_url=redis_url
581+
)

0 commit comments

Comments
 (0)