fix(partners): isolate unit tests from network [closes #39727] (#39729)

Co-authored-by: pufuki <pvnxarc@gmail.com>
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-08-18 18:00:36 -04:00
1 parent c8b2d767bf
commit f368888e7e
4 files changed
+16 -18

No files matched your search

+2 -5
View File
@@ -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)
+1 -1
View 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:
+2 -5
View File
@@ -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)