Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme committed Dec 9, 2024
1 parent 96432a9 commit 34adeb0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 45 deletions.
45 changes: 4 additions & 41 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pytest-asyncio = "^0.23.2"
pytest-socket = "^0.7.0"
pytest-cov = "^5.0.0"
pytest-timeout = "^2.3.1"
langchain-tests = "0.3.6"
langchain-tests = "0.3.7"

[tool.poetry.group.codespell]
optional = true
Expand Down
25 changes: 22 additions & 3 deletions tests/unit_tests/test_vectorstore_standard_tests.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from typing import Generator
from typing import AsyncGenerator, Generator

import pytest
from langchain_core.vectorstores import VectorStore
from langchain_tests.integration_tests import VectorStoreIntegrationTests

from tests.unit_tests.test_vectorstore import get_vectorstore
from tests.unit_tests.test_vectorstore import aget_vectorstore, get_vectorstore


class TestStandard(VectorStoreIntegrationTests):
class TestSync(VectorStoreIntegrationTests):
@pytest.fixture()
def vectorstore(self) -> Generator[VectorStore, None, None]: # type: ignore
"""Get an empty vectorstore for unit tests."""
Expand All @@ -16,3 +16,22 @@ def vectorstore(self) -> Generator[VectorStore, None, None]: # type: ignore
vstore.create_tables_if_not_exists()
vstore.create_collection()
yield vstore

@property
def has_async(self) -> bool:
return False


class TestAsync(VectorStoreIntegrationTests):
@pytest.fixture()
async def vectorstore(self) -> AsyncGenerator[VectorStore, None]: # type: ignore
"""Get an empty vectorstore for unit tests."""
async with aget_vectorstore(embedding=self.get_embeddings()) as vstore:
await vstore.adrop_tables()
await vstore.acreate_tables_if_not_exists()
await vstore.acreate_collection()
yield vstore

@property
def has_sync(self) -> bool:
return False

0 comments on commit 34adeb0

Please sign in to comment.