text-splitters: test without socket (#28732)

This commit is contained in:
Erick Friis 2024-12-15 14:10:35 -08:00 committed by GitHub
parent 690aa02c31
commit 8ec1c72e03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 26 additions and 7 deletions

View File

@ -6,11 +6,8 @@ all: help
# Define a variable for the test file path. # Define a variable for the test file path.
TEST_FILE ?= tests/unit_tests/ TEST_FILE ?= tests/unit_tests/
test: test tests:
poetry run pytest $(TEST_FILE) poetry run pytest --disable-socket --allow-unix-socket $(TEST_FILE)
tests:
poetry run pytest $(TEST_FILE)
test_watch: test_watch:
poetry run ptw --snapshot-update --now . -- -vv -x tests/unit_tests poetry run ptw --snapshot-update --now . -- -vv -x tests/unit_tests

View File

@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. # This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
[[package]] [[package]]
name = "annotated-types" name = "annotated-types"
@ -1995,6 +1995,20 @@ pytest = ">=6.2.5"
[package.extras] [package.extras]
dev = ["pre-commit", "pytest-asyncio", "tox"] dev = ["pre-commit", "pytest-asyncio", "tox"]
[[package]]
name = "pytest-socket"
version = "0.7.0"
description = "Pytest Plugin to disable socket calls during tests"
optional = false
python-versions = ">=3.8,<4.0"
files = [
{file = "pytest_socket-0.7.0-py3-none-any.whl", hash = "sha256:7e0f4642177d55d317bbd58fc68c6bd9048d6eadb2d46a89307fa9221336ce45"},
{file = "pytest_socket-0.7.0.tar.gz", hash = "sha256:71ab048cbbcb085c15a4423b73b619a8b35d6a307f46f78ea46be51b1b7e11b3"},
]
[package.dependencies]
pytest = ">=6.2.5"
[[package]] [[package]]
name = "pytest-watcher" name = "pytest-watcher"
version = "0.3.5" version = "0.3.5"
@ -3039,4 +3053,4 @@ type = ["pytest-mypy"]
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = ">=3.9,<4.0" python-versions = ">=3.9,<4.0"
content-hash = "33f08d0158d06d6b63f2b50aeffc043421413d306d0777c78cf0a7a3c67c4457" content-hash = "9dd026d137efc790cfa99df8cc39ff86f052b8b22a8348a22b3ef0aefc304f04"

View File

@ -58,32 +58,40 @@ convention = "google"
[tool.poetry.group.lint.dependencies] [tool.poetry.group.lint.dependencies]
ruff = "^0.5" ruff = "^0.5"
[tool.poetry.group.typing.dependencies] [tool.poetry.group.typing.dependencies]
mypy = "^1.10" mypy = "^1.10"
lxml-stubs = "^0.5.1" lxml-stubs = "^0.5.1"
types-requests = "^2.31.0.20240218" types-requests = "^2.31.0.20240218"
tiktoken = "^0.8.0" tiktoken = "^0.8.0"
[tool.poetry.group.dev.dependencies] [tool.poetry.group.dev.dependencies]
jupyter = "^1.0.0" jupyter = "^1.0.0"
[tool.poetry.group.test.dependencies] [tool.poetry.group.test.dependencies]
pytest = "^8" pytest = "^8"
freezegun = "^1.2.2" freezegun = "^1.2.2"
pytest-mock = "^3.10.0" pytest-mock = "^3.10.0"
pytest-watcher = "^0.3.4" pytest-watcher = "^0.3.4"
pytest-asyncio = "^0.21.1" pytest-asyncio = "^0.21.1"
pytest-socket = "^0.7.0"
[tool.poetry.group.test_integration.dependencies] [tool.poetry.group.test_integration.dependencies]
[tool.poetry.group.lint.dependencies.langchain-core] [tool.poetry.group.lint.dependencies.langchain-core]
path = "../core" path = "../core"
develop = true develop = true
[tool.poetry.group.dev.dependencies.langchain-core] [tool.poetry.group.dev.dependencies.langchain-core]
path = "../core" path = "../core"
develop = true develop = true
[tool.poetry.group.test.dependencies.langchain-core] [tool.poetry.group.test.dependencies.langchain-core]
path = "../core" path = "../core"
develop = true develop = true