Skip to content

Commit 647fa4a

Browse files
committed
fix a patch
1 parent 0a69c84 commit 647fa4a

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

tests/conftest.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -329,18 +329,11 @@ async def mock_get_redis_conn(*args, **kwargs):
329329
print(f"DEBUG: Returning replacement_redis: {replacement_redis}")
330330
return replacement_redis
331331

332-
print(
333-
"DEBUG: Patching agent_memory_server.utils.redis.get_redis_conn with mock function"
334-
)
335-
with patch("agent_memory_server.utils.redis.get_redis_conn", mock_get_redis_conn):
336-
# Also patch the re-exported function in db.redis
337-
print(
338-
"DEBUG: Patching agent_memory_server.db.redis.get_redis_conn with mock function"
339-
)
340-
with patch("agent_memory_server.db.redis.get_redis_conn", mock_get_redis_conn):
341-
print(f"DEBUG: Yielding replacement_redis: {replacement_redis}")
342-
yield replacement_redis
343-
print("DEBUG: Exiting use_test_redis_connection fixture")
332+
with (
333+
patch("agent_memory_server.utils.redis.get_redis_conn", mock_get_redis_conn),
334+
patch("agent_memory_server.utils.redis.get_redis_conn", mock_get_redis_conn),
335+
):
336+
yield replacement_redis
344337

345338

346339
def pytest_addoption(parser: pytest.Parser) -> None:

0 commit comments

Comments
 (0)