mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-20 22:03:52 +00:00
cli[minor]: Add disable sockets in unit tests (#19877)
This commit is contained in:
parent
ea276d6547
commit
6f20f140ca
@ -7,7 +7,13 @@ all: help
|
|||||||
TEST_FILE ?= tests/unit_tests/
|
TEST_FILE ?= tests/unit_tests/
|
||||||
integration_test integration_tests: TEST_FILE = tests/integration_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)
|
poetry run pytest $(TEST_FILE)
|
||||||
|
|
||||||
######################
|
######################
|
||||||
|
@ -20,6 +20,7 @@ optional = true
|
|||||||
[tool.poetry.group.test.dependencies]
|
[tool.poetry.group.test.dependencies]
|
||||||
pytest = "^7.4.3"
|
pytest = "^7.4.3"
|
||||||
pytest-asyncio = "^0.23.2"
|
pytest-asyncio = "^0.23.2"
|
||||||
|
pytest-socket = "^0.7.0"
|
||||||
langchain-core = {path = "../../core", develop = true}
|
langchain-core = {path = "../../core", develop = true}
|
||||||
|
|
||||||
[tool.poetry.group.codespell]
|
[tool.poetry.group.codespell]
|
||||||
|
Loading…
Reference in New Issue
Block a user