@@ -99,9 +99,10 @@ def test_create_store(vector_store):
99
99
assert vector_store .connection_pool is not None
100
100
101
101
102
- @pytest .mark .asyncio
102
+ @pytest .mark .asyncio ( scope = "session" )
103
103
async def test_create_does_collection_exist_and_delete (vector_store : PostgresStore ):
104
104
suffix = str (uuid .uuid4 ()).replace ("-" , "" )[:8 ]
105
+
105
106
collection = vector_store .get_collection (f"test_collection_{ suffix } " , SimpleDataModel )
106
107
107
108
does_exist_1 = await collection .does_collection_exist ()
@@ -116,14 +117,14 @@ async def test_create_does_collection_exist_and_delete(vector_store: PostgresSto
116
117
assert does_exist_3 is False
117
118
118
119
119
- @pytest .mark .asyncio
120
+ @pytest .mark .asyncio ( scope = "session" )
120
121
async def test_list_collection_names (vector_store , simple_collection ):
121
122
simple_collection_id = simple_collection .collection_name
122
123
result = await vector_store .list_collection_names ()
123
124
assert simple_collection_id in result
124
125
125
126
126
- @pytest .mark .asyncio
127
+ @pytest .mark .asyncio ( scope = "session" )
127
128
async def test_upsert_get_and_delete (simple_collection : PostgresCollection ):
128
129
record = SimpleDataModel (id = 1 , embedding = [1.1 , 2.2 , 3.3 ], data = {"key" : "value" })
129
130
@@ -150,7 +151,7 @@ async def test_upsert_get_and_delete(simple_collection: PostgresCollection):
150
151
assert result_after_delete is None
151
152
152
153
153
- @pytest .mark .asyncio
154
+ @pytest .mark .asyncio ( scope = "session" )
154
155
async def test_upsert_get_and_delete_pandas (vector_store ):
155
156
record = SimpleDataModel (id = 1 , embedding = [1.1 , 2.2 , 3.3 ], data = {"key" : "value" })
156
157
definition , df = DataModelPandas (record .model_dump ())
@@ -180,7 +181,7 @@ async def test_upsert_get_and_delete_pandas(vector_store):
180
181
await collection .delete_collection ()
181
182
182
183
183
- @pytest .mark .asyncio
184
+ @pytest .mark .asyncio ( scope = "session" )
184
185
async def test_upsert_get_and_delete_batch (simple_collection : VectorStoreRecordCollection ):
185
186
record1 = SimpleDataModel (id = 1 , embedding = [1.1 , 2.2 , 3.3 ], data = {"key" : "value" })
186
187
record2 = SimpleDataModel (id = 2 , embedding = [4.4 , 5.5 , 6.6 ], data = {"key" : "value" })
0 commit comments