cli[minor]: Add disable sockets in unit tests (#19877)

This commit is contained in:
Eugene Yurtsev 2024-04-03 17:17:50 -04:00 committed by GitHub
parent ea276d6547
commit 6f20f140ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -7,7 +7,13 @@ all: help
TEST_FILE ?= tests/unit_tests/
integration_test integration_tests: TEST_FILE = tests/integration_tests/
test tests integration_test integration_tests:
# unit tests are run with the --disable-socket flag to prevent network calls
test tests:
poetry run pytest --disable-socket --allow-unit-socket $(TEST_FILE)
# integration tests are run without the --disable-socket flag to allow network calls
integration_test integration_tests:
poetry run pytest $(TEST_FILE)
######################

View File

@ -20,6 +20,7 @@ optional = true
[tool.poetry.group.test.dependencies]
pytest = "^7.4.3"
pytest-asyncio = "^0.23.2"
pytest-socket = "^0.7.0"
langchain-core = {path = "../../core", develop = true}
[tool.poetry.group.codespell]