Skip to content

The agent engineering platform.

fix upstash test import (#11781)

Bagatur1559ba4bfc91
diff --git a/libs/langchain/tests/integration_tests/storage/test_upstash_redis.py b/libs/langchain/tests/integration_tests/storage/test_upstash_redis.py
index ead1cd06fc..183e09515b 100644
--- a/libs/langchain/tests/integration_tests/storage/test_upstash_redis.py
+++ b/libs/langchain/tests/integration_tests/storage/test_upstash_redis.py
@@ -1,10 +1,15 @@
"""Implement integration tests for Redis storage."""
+from __future__ import annotations
+
+from typing import TYPE_CHECKING
import pytest
-from upstash_redis import Redis
from langchain.storage.upstash_redis import UpstashRedisStore
+if TYPE_CHECKING:
+ from upstash_redis import Redis
+
pytest.importorskip("upstash_redis")
URL = "<UPSTASH_REDIS_REST_URL>"