From 1007a715a50b1c86ff9f8020983e9d21d70cddd0 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Wed, 19 Jun 2024 10:56:30 -0400 Subject: [PATCH] community[patch]: Prevent unit tests from making network requests (#23180) * Prevent unit tests from making network requests --- libs/community/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/community/Makefile b/libs/community/Makefile index bb5631a2ec..64611daf05 100644 --- a/libs/community/Makefile +++ b/libs/community/Makefile @@ -15,17 +15,20 @@ coverage: --cov-report term-missing:skip-covered \ $(TEST_FILE) -test tests integration_tests: +test tests: + poetry run pytest --disable-socket --allow-unix-socket $(TEST_FILE) + +integration_tests: poetry run pytest $(TEST_FILE) test_watch: - poetry run ptw --snapshot-update --now . -- -vv -x tests/unit_tests + poetry run ptw --disable-socket --allow-unix-socket --snapshot-update --now . -- -vv -x tests/unit_tests check_imports: $(shell find langchain_community -name '*.py') poetry run python ./scripts/check_imports.py $^ extended_tests: - poetry run pytest --only-extended tests/unit_tests + poetry run pytest --disable-socket --allow-unix-socket --only-extended tests/unit_tests ######################