@@ -119,48 +119,19 @@ async def test_cursor_fetch_all(
119119 assert await cursor .fetchall () == []
120120
121121 @pytest .mark .asyncio
122- async def test_cursor_next_set (
122+ async def test_cursor_fetch_one_multiple_result_sets (
123123 self , session : ydb .aio .QuerySession
124124 ) -> None :
125125 async with ydb_dbapi .AsyncCursor (session = session ) as cursor :
126- yql_text = """SELECT 1 as val; SELECT 2 as val;"""
127- await cursor .execute (query = yql_text )
128-
129- res = await cursor .fetchall ()
130- assert res is not None
131- assert len (res ) == 1
132- assert res [0 ][0 ] == 1
133-
134- nextset = await cursor .nextset ()
135- assert nextset
136-
137- res = await cursor .fetchall ()
138- assert res is not None
139- assert len (res ) == 1
140- assert res [0 ][0 ] == 2
141-
142- nextset = await cursor .nextset ()
143- assert nextset
144-
145- assert await cursor .fetchall () == []
146-
147- nextset = await cursor .nextset ()
148- assert not nextset
149-
150- @pytest .mark .asyncio
151- async def test_cursor_fetch_one_autoscroll (
152- self , session : ydb .aio .QuerySession
153- ) -> None :
154- async with ydb_dbapi .AsyncCursor (
155- session = session , auto_scroll_result_sets = True
156- ) as cursor :
157126 yql_text = """
158127 SELECT id, val FROM table;
159128 SELECT id, val FROM table1;
160129 SELECT id, val FROM table2;
161130 """
162131 await cursor .execute (query = yql_text )
163132
133+ assert cursor .rowcount == 12
134+
164135 for i in range (RESULT_SET_LENGTH * RESULT_SET_COUNT ):
165136 res = await cursor .fetchone ()
166137 assert res is not None
@@ -170,19 +141,19 @@ async def test_cursor_fetch_one_autoscroll(
170141 assert not await cursor .nextset ()
171142
172143 @pytest .mark .asyncio
173- async def test_cursor_fetch_many_autoscroll (
144+ async def test_cursor_fetch_many_multiple_result_sets (
174145 self , session : ydb .aio .QuerySession
175146 ) -> None :
176- async with ydb_dbapi .AsyncCursor (
177- session = session , auto_scroll_result_sets = True
178- ) as cursor :
147+ async with ydb_dbapi .AsyncCursor (session = session ) as cursor :
179148 yql_text = """
180149 SELECT id, val FROM table;
181150 SELECT id, val FROM table1;
182151 SELECT id, val FROM table2;
183152 """
184153 await cursor .execute (query = yql_text )
185154
155+ assert cursor .rowcount == 12
156+
186157 halfsize = (RESULT_SET_LENGTH * RESULT_SET_COUNT ) // 2
187158 for _ in range (2 ):
188159 res = await cursor .fetchmany (size = halfsize )
@@ -193,19 +164,19 @@ async def test_cursor_fetch_many_autoscroll(
193164 assert not await cursor .nextset ()
194165
195166 @pytest .mark .asyncio
196- async def test_cursor_fetch_all_autoscroll (
167+ async def test_cursor_fetch_all_multiple_result_sets (
197168 self , session : ydb .aio .QuerySession
198169 ) -> None :
199- async with ydb_dbapi .AsyncCursor (
200- session = session , auto_scroll_result_sets = True
201- ) as cursor :
170+ async with ydb_dbapi .AsyncCursor (session = session ) as cursor :
202171 yql_text = """
203172 SELECT id, val FROM table;
204173 SELECT id, val FROM table1;
205174 SELECT id, val FROM table2;
206175 """
207176 await cursor .execute (query = yql_text )
208177
178+ assert cursor .rowcount == 12
179+
209180 res = await cursor .fetchall ()
210181
211182 assert len (res ) == RESULT_SET_COUNT * RESULT_SET_LENGTH
@@ -274,45 +245,19 @@ def test_cursor_fetch_all(self, session_sync: ydb.QuerySession) -> None:
274245
275246 assert cursor .fetchall () == []
276247
277- def test_cursor_next_set (self , session_sync : ydb .QuerySession ) -> None :
278- with ydb_dbapi .Cursor (session = session_sync ) as cursor :
279- yql_text = """SELECT 1 as val; SELECT 2 as val;"""
280- cursor .execute (query = yql_text )
281-
282- res = cursor .fetchall ()
283- assert res is not None
284- assert len (res ) == 1
285- assert res [0 ][0 ] == 1
286-
287- nextset = cursor .nextset ()
288- assert nextset
289-
290- res = cursor .fetchall ()
291- assert res is not None
292- assert len (res ) == 1
293- assert res [0 ][0 ] == 2
294-
295- nextset = cursor .nextset ()
296- assert nextset
297-
298- assert cursor .fetchall () == []
299-
300- nextset = cursor .nextset ()
301- assert not nextset
302-
303- def test_cursor_fetch_one_autoscroll (
248+ def test_cursor_fetch_one_multiple_result_sets (
304249 self , session_sync : ydb .QuerySession
305250 ) -> None :
306- with ydb_dbapi .Cursor (
307- session = session_sync , auto_scroll_result_sets = True
308- ) as cursor :
251+ with ydb_dbapi .Cursor (session = session_sync ) as cursor :
309252 yql_text = """
310253 SELECT id, val FROM table;
311254 SELECT id, val FROM table1;
312255 SELECT id, val FROM table2;
313256 """
314257 cursor .execute (query = yql_text )
315258
259+ assert cursor .rowcount == 12
260+
316261 for i in range (RESULT_SET_LENGTH * RESULT_SET_COUNT ):
317262 res = cursor .fetchone ()
318263 assert res is not None
@@ -321,19 +266,19 @@ def test_cursor_fetch_one_autoscroll(
321266 assert cursor .fetchone () is None
322267 assert not cursor .nextset ()
323268
324- def test_cursor_fetch_many_autoscroll (
269+ def test_cursor_fetch_many_multiple_result_sets (
325270 self , session_sync : ydb .QuerySession
326271 ) -> None :
327- with ydb_dbapi .Cursor (
328- session = session_sync , auto_scroll_result_sets = True
329- ) as cursor :
272+ with ydb_dbapi .Cursor (session = session_sync ) as cursor :
330273 yql_text = """
331274 SELECT id, val FROM table;
332275 SELECT id, val FROM table1;
333276 SELECT id, val FROM table2;
334277 """
335278 cursor .execute (query = yql_text )
336279
280+ assert cursor .rowcount == 12
281+
337282 halfsize = (RESULT_SET_LENGTH * RESULT_SET_COUNT ) // 2
338283 for _ in range (2 ):
339284 res = cursor .fetchmany (size = halfsize )
@@ -343,19 +288,19 @@ def test_cursor_fetch_many_autoscroll(
343288 assert cursor .fetchmany (2 ) == []
344289 assert not cursor .nextset ()
345290
346- def test_cursor_fetch_all_autoscroll (
291+ def test_cursor_fetch_all_multiple_result_sets (
347292 self , session_sync : ydb .QuerySession
348293 ) -> None :
349- with ydb_dbapi .Cursor (
350- session = session_sync , auto_scroll_result_sets = True
351- ) as cursor :
294+ with ydb_dbapi .Cursor (session = session_sync ) as cursor :
352295 yql_text = """
353296 SELECT id, val FROM table;
354297 SELECT id, val FROM table1;
355298 SELECT id, val FROM table2;
356299 """
357300 cursor .execute (query = yql_text )
358301
302+ assert cursor .rowcount == 12
303+
359304 res = cursor .fetchall ()
360305
361306 assert len (res ) == RESULT_SET_COUNT * RESULT_SET_LENGTH
0 commit comments