mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-06 13:33:37 +00:00
multiple: rely on asyncio_mode auto in tests (#27200)
This commit is contained in:
@@ -13,7 +13,6 @@ except ImportError:
|
||||
|
||||
|
||||
@pytest.mark.skipif(not IMPORTED_TORCH, reason="torch not installed")
|
||||
@pytest.mark.asyncio
|
||||
async def test_local_infinity_embeddings() -> None:
|
||||
embedder = InfinityEmbeddingsLocal(
|
||||
model="TaylorAI/bge-micro-v2",
|
||||
|
@@ -273,7 +273,6 @@ async def async_gen_mock_streaming_response() -> AsyncGenerator[Dict, None]:
|
||||
yield item
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_bedrock_async_streaming_call() -> None:
|
||||
# Mock boto3 import
|
||||
mock_boto3 = MagicMock()
|
||||
|
@@ -1,6 +1,5 @@
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
import responses
|
||||
|
||||
from langchain_community.retrievers.you import YouRetriever
|
||||
@@ -63,7 +62,6 @@ class TestYouRetriever:
|
||||
expected_result = NEWS_RESPONSE_PARSED
|
||||
assert results == expected_result
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_ainvoke(self) -> None:
|
||||
instance = YouRetriever(ydc_api_key="test_api_key")
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
import responses
|
||||
|
||||
from langchain_community.tools.you import YouSearchTool
|
||||
@@ -68,7 +67,6 @@ class TestYouSearchTool:
|
||||
expected_result = NEWS_RESPONSE_PARSED
|
||||
assert results == expected_result
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_ainvoke(self) -> None:
|
||||
you_tool = YouSearchTool(api_wrapper=YouSearchAPIWrapper(ydc_api_key="test")) # type: ignore[call-arg]
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
import responses
|
||||
from langchain_core.documents import Document
|
||||
|
||||
@@ -189,7 +188,6 @@ def test_results_news() -> None:
|
||||
assert raw_results == expected_result
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_raw_results_async() -> None:
|
||||
instance = YouSearchAPIWrapper(ydc_api_key="test_api_key")
|
||||
|
||||
@@ -208,7 +206,6 @@ async def test_raw_results_async() -> None:
|
||||
assert results == MOCK_RESPONSE_RAW
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_results_async() -> None:
|
||||
instance = YouSearchAPIWrapper(ydc_api_key="test_api_key")
|
||||
|
||||
@@ -227,7 +224,6 @@ async def test_results_async() -> None:
|
||||
assert results == MOCK_PARSED_OUTPUT
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_results_news_async() -> None:
|
||||
instance = YouSearchAPIWrapper(endpoint_type="news", ydc_api_key="test_api_key")
|
||||
|
||||
|
Reference in New Issue
Block a user