File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -222,11 +222,15 @@ async def test_transaction_execute_many(
222222) -> None :
223223 connection = await psql_pool .connection ()
224224 async with connection .transaction () as transaction :
225- await transaction .execute_many (
226- f"INSERT INTO { table_name } VALUES ($1, $2)" ,
227- insert_values ,
228- )
229- assert await count_rows_in_test_table (
230- table_name ,
231- transaction ,
232- ) - number_database_records == len (insert_values )
225+ try :
226+ await transaction .execute_many (
227+ f"INSERT INTO { table_name } VALUES ($1, $2)" ,
228+ insert_values ,
229+ )
230+ except DBTransactionError :
231+ assert not insert_values
232+ else :
233+ assert await count_rows_in_test_table (
234+ table_name ,
235+ transaction ,
236+ ) - number_database_records == len (insert_values )
You can’t perform that action at this time.
0 commit comments