mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-05 09:25:14 +03:00
Co-authored-by: pufuki <pvnxarc@gmail.com> Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
This commit is contained in:
4 files changed
+16
-18
No files matched your search
@@ -12,15 +12,12 @@ PYTEST_EXTRA ?=
|
||||
|
||||
integration_test integration_tests: TEST_FILE=tests/integration_tests/
|
||||
|
||||
test:
|
||||
uv run --group test --group test_integration pytest $(PYTEST_EXTRA) $(TEST_FILE)
|
||||
test tests:
|
||||
uv run --group test pytest $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE)
|
||||
|
||||
integration_test integration_tests:
|
||||
uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable $(PYTEST_EXTRA) $(TEST_FILE)
|
||||
|
||||
tests:
|
||||
uv run --group test pytest $(PYTEST_EXTRA) $(TEST_FILE)
|
||||
|
||||
test_watch:
|
||||
uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ PYTEST_EXTRA ?=
|
||||
integration_test integration_tests: TEST_FILE=$(INTEGRATION_TEST_FILE)
|
||||
|
||||
test tests:
|
||||
uv run --group test pytest $(PYTEST_EXTRA) $(TEST_FILE)
|
||||
uv run --group test pytest $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE)
|
||||
|
||||
test_watch:
|
||||
uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
from typing import cast
|
||||
from unittest.mock import MagicMock
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import httpx
|
||||
from pydantic import SecretStr
|
||||
@@ -15,12 +15,16 @@ os.environ["MISTRAL_API_KEY"] = "foo"
|
||||
|
||||
|
||||
def test_mistral_init() -> None:
|
||||
for model in [
|
||||
MistralAIEmbeddings(model="mistral-embed", mistral_api_key="test"), # type: ignore[call-arg]
|
||||
MistralAIEmbeddings(model="mistral-embed", api_key="test"), # type: ignore[arg-type]
|
||||
]:
|
||||
assert model.model == "mistral-embed"
|
||||
assert cast("SecretStr", model.mistral_api_key).get_secret_value() == "test"
|
||||
with patch(
|
||||
"langchain_mistralai.embeddings.Tokenizer.from_pretrained",
|
||||
return_value=MagicMock(),
|
||||
):
|
||||
for model in [
|
||||
MistralAIEmbeddings(model="mistral-embed", mistral_api_key="test"), # type: ignore[call-arg]
|
||||
MistralAIEmbeddings(model="mistral-embed", api_key="test"), # type: ignore[arg-type]
|
||||
]:
|
||||
assert model.model == "mistral-embed"
|
||||
assert cast("SecretStr", model.mistral_api_key).get_secret_value() == "test"
|
||||
|
||||
|
||||
def test_is_retryable_error_timeout() -> None:
|
||||
|
||||
@@ -12,15 +12,12 @@ PYTEST_EXTRA ?=
|
||||
|
||||
integration_test integration_tests: TEST_FILE = tests/integration_tests/
|
||||
|
||||
test:
|
||||
uv run --group test --group test_integration pytest $(PYTEST_EXTRA) $(TEST_FILE)
|
||||
test tests:
|
||||
uv run --group test pytest $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE)
|
||||
|
||||
integration_test integration_tests:
|
||||
uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable $(PYTEST_EXTRA) $(TEST_FILE)
|
||||
|
||||
tests:
|
||||
uv run --group test pytest $(PYTEST_EXTRA) $(TEST_FILE)
|
||||
|
||||
test_watch:
|
||||
uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE)
|
||||
|
||||
|
||||
Reference in new issue
Block a user