1
1
import os
2
2
import uuid
3
- from typing import AsyncIterator
3
+ from typing import AsyncGenerator , AsyncIterator
4
4
5
5
import pytest
6
6
import pytest_asyncio
@@ -39,7 +39,7 @@ async def run(engine: PGEngine, query: str) -> None:
39
39
@pytest .mark .asyncio
40
40
class TestStandardSuiteSync (VectorStoreIntegrationTests ):
41
41
@pytest_asyncio .fixture (scope = "function" )
42
- async def sync_engine (self ) -> AsyncIterator [PGEngine ]:
42
+ async def sync_engine (self ) -> AsyncGenerator [PGEngine , None ]:
43
43
sync_engine = PGEngine .from_connection_string (url = CONNECTION_STRING )
44
44
yield sync_engine
45
45
await aexecute (sync_engine , f'DROP TABLE IF EXISTS "{ DEFAULT_TABLE_SYNC } "' )
@@ -63,7 +63,6 @@ def vectorstore(self, sync_engine: PGEngine) -> PGVectorStore: # type: ignore
63
63
64
64
65
65
@pytest .mark .enable_socket
66
- # @pytest.mark.filterwarnings("ignore")
67
66
@pytest .mark .asyncio
68
67
class TestStandardSuiteAsync (VectorStoreIntegrationTests ):
69
68
@pytest_asyncio .fixture (scope = "function" )
@@ -74,7 +73,9 @@ async def async_engine(self) -> AsyncIterator[PGEngine]:
74
73
await async_engine .close ()
75
74
76
75
@pytest_asyncio .fixture (scope = "function" )
77
- async def vectorstore (self , async_engine : PGEngine ) -> AsyncIterator [PGVectorStore ]:
76
+ async def vectorstore ( # type: ignore[override]
77
+ self , async_engine : PGEngine
78
+ ) -> AsyncGenerator [PGVectorStore , None ]: # type: ignore
78
79
"""Get an empty vectorstore for unit tests."""
79
80
await async_engine .ainit_vectorstore_table (
80
81
DEFAULT_TABLE ,
0 commit comments