@@ -21,7 +21,7 @@ class YDBContainer(DbContainer):
21
21
def __init__ (
22
22
self ,
23
23
name : str | None = None ,
24
- port : str = "2135 " ,
24
+ port : str = "2136 " ,
25
25
image : str = "ydbplatform/local-ydb:trunk" ,
26
26
** kwargs : Any ,
27
27
) -> None :
@@ -104,12 +104,12 @@ def ydb_container(
104
104
yield ydb_container
105
105
106
106
107
- @pytest .fixture
107
+ @pytest .fixture ( scope = "session" )
108
108
def connection_string (ydb_container : YDBContainer ) -> str :
109
109
return ydb_container .get_connection_string ()
110
110
111
111
112
- @pytest .fixture
112
+ @pytest .fixture ( scope = "session" )
113
113
def connection_kwargs (ydb_container : YDBContainer ) -> dict :
114
114
return {
115
115
"host" : ydb_container .get_ydb_host (),
@@ -120,12 +120,11 @@ def connection_kwargs(ydb_container: YDBContainer) -> dict:
120
120
121
121
@pytest .fixture
122
122
async def driver (
123
- ydb_container : YDBContainer , event_loop : AbstractEventLoop
123
+ connection_string : str ,
124
+ event_loop : AbstractEventLoop ,
124
125
) -> AsyncGenerator [ydb .aio .Driver ]:
125
- driver = ydb .aio .Driver (
126
- connection_string = ydb_container .get_connection_string ()
127
- )
128
- await driver .wait (timeout = 15 , fail_fast = True )
126
+ driver = ydb .aio .Driver (connection_string = connection_string )
127
+ await driver .wait (timeout = 10 )
129
128
130
129
yield driver
131
130
@@ -135,12 +134,10 @@ async def driver(
135
134
136
135
@pytest .fixture
137
136
def driver_sync (
138
- ydb_container : YDBContainer ,
137
+ connection_string : str ,
139
138
) -> Generator [ydb .Driver ]:
140
- driver = ydb .Driver (
141
- connection_string = ydb_container .get_connection_string ()
142
- )
143
- driver .wait (timeout = 15 , fail_fast = True )
139
+ driver = ydb .Driver (connection_string = connection_string )
140
+ driver .wait (timeout = 10 )
144
141
145
142
yield driver
146
143
@@ -187,25 +184,3 @@ def session_pool_sync(
187
184
"""
188
185
)
189
186
yield session_pool
190
-
191
-
192
- @pytest .fixture
193
- async def session (
194
- session_pool : ydb .aio .QuerySessionPool ,
195
- ) -> AsyncGenerator [ydb .aio .QuerySession ]:
196
- session = await session_pool .acquire ()
197
-
198
- yield session
199
-
200
- await session_pool .release (session )
201
-
202
-
203
- @pytest .fixture
204
- def session_sync (
205
- session_pool_sync : ydb .QuerySessionPool ,
206
- ) -> Generator [ydb .QuerySession ]:
207
- session = session_pool_sync .acquire ()
208
-
209
- yield session
210
-
211
- session_pool_sync .release (session )
0 commit comments