@@ -63,8 +63,9 @@ async def test_closed_cursor(cursor: Cursor):
6363 ("fetchone" , ()),
6464 ("fetchmany" , ()),
6565 ("fetchall" , ()),
66+ ("nextset" , ()),
6667 )
67- methods = ("setinputsizes" , "setoutputsize" , "nextset" )
68+ methods = ("setinputsizes" , "setoutputsize" )
6869
6970 cursor .close ()
7071
@@ -439,8 +440,11 @@ async def test_cursor_multi_statement(
439440 httpx_mock .add_callback (auth_callback , url = auth_url )
440441 httpx_mock .add_callback (query_callback , url = query_url )
441442 httpx_mock .add_callback (insert_query_callback , url = query_url )
443+ httpx_mock .add_callback (query_callback , url = query_url )
442444
443- rc = await cursor .execute ("select * from t; insert into t values (1, 2)" )
445+ rc = await cursor .execute (
446+ "select * from t; insert into t values (1, 2); select * from t"
447+ )
444448 assert rc == len (python_query_data ), "Invalid row count returned"
445449 assert cursor .rowcount == len (python_query_data ), "Invalid cursor row count"
446450 for i , (desc , exp ) in enumerate (zip (cursor .description , python_query_description )):
@@ -451,12 +455,23 @@ async def test_cursor_multi_statement(
451455 await cursor .fetchone () == python_query_data [i ]
452456 ), f"Invalid data row at position { i } "
453457
454- assert cursor .nextset ()
458+ assert await cursor .nextset ()
455459 assert cursor .rowcount == - 1 , "Invalid cursor row count"
456460 assert cursor .description is None , "Invalid cursor description"
457461 with raises (DataError ) as exc_info :
458462 await cursor .fetchall ()
459463
460464 assert str (exc_info .value ) == "no rows to fetch" , "Invalid error message"
461465
462- assert cursor .nextset () is None
466+ assert await cursor .nextset ()
467+
468+ assert cursor .rowcount == len (python_query_data ), "Invalid cursor row count"
469+ for i , (desc , exp ) in enumerate (zip (cursor .description , python_query_description )):
470+ assert desc == exp , f"Invalid column description at position { i } "
471+
472+ for i in range (cursor .rowcount ):
473+ assert (
474+ await cursor .fetchone () == python_query_data [i ]
475+ ), f"Invalid data row at position { i } "
476+
477+ assert await cursor .nextset () is None
0 commit comments