@@ -681,19 +681,21 @@ async def test_8815(async_conn, async_cursor, test_env):
681681 await async_cursor .execute (f"drop table { temp_table_name } purge" )
682682
683683
684- async def test_8816 (async_conn , async_cursor , test_env ):
684+ async def test_8816 (test_env ):
685685 "8816 - test suspend_on_success with batch_size < total rows inserted"
686- await async_cursor .execute ("truncate table TestTempTable" )
687- rows = [(i + 1 , f"String for row { i + 1 } " ) for i in range (200 )]
688- await async_conn .begin_sessionless_transaction (
689- transaction_id = TRANSACTION_ID_CLIENT ,
690- timeout = 15 ,
691- defer_round_trip = True ,
692- )
693- with test_env .assert_raises_full_code ("DPY-3036" ):
694- await async_cursor .executemany (
695- "insert into TestTempTable (IntCol, StringCol1) values (:1, :2)" ,
696- rows ,
697- batch_size = 75 ,
698- suspend_on_success = True ,
686+ async with test_env .get_connection_async () as conn :
687+ cursor = conn .cursor ()
688+ await cursor .execute ("truncate table TestTempTable" )
689+ rows = [(i + 1 , f"String for row { i + 1 } " ) for i in range (200 )]
690+ await conn .begin_sessionless_transaction (
691+ transaction_id = TRANSACTION_ID_CLIENT ,
692+ timeout = 5 ,
693+ defer_round_trip = True ,
699694 )
695+ sql = "insert into TestTempTable (IntCol, StringCol1) values (:1, :2)"
696+ with test_env .assert_raises_full_code ("DPY-3036" ):
697+ await cursor .executemany (
698+ sql , rows , batch_size = 75 , suspend_on_success = True
699+ )
700+ async with test_env .get_connection_async () as conn :
701+ await conn .resume_sessionless_transaction (TRANSACTION_ID_CLIENT )
0 commit comments