66from tests .helpers import count_rows_in_test_table
77
88from psqlpy import Cursor , IsolationLevel , PSQLPool , ReadVariant
9- from psqlpy .exceptions import DBTransactionError , RustPSQLDriverPyBaseError
9+ from psqlpy .exceptions import RustPSQLDriverPyBaseError , TransactionError
1010
1111pytestmark = pytest .mark .anyio
1212
@@ -55,7 +55,7 @@ async def test_transaction_begin(
5555 connection = await psql_pool .connection ()
5656 transaction = connection .transaction ()
5757
58- with pytest .raises (expected_exception = DBTransactionError ):
58+ with pytest .raises (expected_exception = TransactionError ):
5959 await transaction .execute (
6060 f"SELECT * FROM { table_name } " ,
6161 )
@@ -157,7 +157,7 @@ async def test_transaction_rollback(
157157
158158 await transaction .rollback ()
159159
160- with pytest .raises (expected_exception = DBTransactionError ):
160+ with pytest .raises (expected_exception = TransactionError ):
161161 await transaction .execute (
162162 f"SELECT * FROM { table_name } WHERE name = $1" ,
163163 parameters = [test_name ],
@@ -184,7 +184,7 @@ async def test_transaction_release_savepoint(
184184
185185 await transaction .savepoint (sp_name_1 )
186186
187- with pytest .raises (expected_exception = DBTransactionError ):
187+ with pytest .raises (expected_exception = TransactionError ):
188188 await transaction .savepoint (sp_name_1 )
189189
190190 await transaction .savepoint (sp_name_2 )
@@ -227,7 +227,7 @@ async def test_transaction_execute_many(
227227 f"INSERT INTO { table_name } VALUES ($1, $2)" ,
228228 insert_values ,
229229 )
230- except DBTransactionError :
230+ except TransactionError :
231231 assert not insert_values
232232 else :
233233 assert await count_rows_in_test_table (
0 commit comments