33import pytest
44
55from arangoasync .database import TransactionDatabase
6- from arangoasync .errno import FORBIDDEN , TRANSACTION_NOT_FOUND
6+ from arangoasync .errno import BAD_PARAMETER , FORBIDDEN , TRANSACTION_NOT_FOUND
77from arangoasync .exceptions import (
88 TransactionAbortError ,
99 TransactionCommitError ,
@@ -74,7 +74,8 @@ async def test_transaction_status(db, doc_col):
7474 txn_db = db .fetch_transaction ("illegal" )
7575 with pytest .raises (TransactionStatusError ) as err :
7676 await txn_db .transaction_status ()
77- assert err .value .error_code == TRANSACTION_NOT_FOUND
77+ # Error code differs between single server and cluster mode
78+ assert err .value .error_code in {BAD_PARAMETER , TRANSACTION_NOT_FOUND }
7879
7980
8081@pytest .mark .asyncio
@@ -101,7 +102,8 @@ async def test_transaction_commit(db, doc_col, docs):
101102 txn_db = db .fetch_transaction ("illegal" )
102103 with pytest .raises (TransactionCommitError ) as err :
103104 await txn_db .commit_transaction ()
104- assert err .value .error_code == TRANSACTION_NOT_FOUND
105+ # Error code differs between single server and cluster mode
106+ assert err .value .error_code in {BAD_PARAMETER , TRANSACTION_NOT_FOUND }
105107
106108
107109@pytest .mark .asyncio
@@ -126,7 +128,8 @@ async def test_transaction_abort(db, doc_col, docs):
126128 txn_db = db .fetch_transaction ("illegal" )
127129 with pytest .raises (TransactionAbortError ) as err :
128130 await txn_db .abort_transaction ()
129- assert err .value .error_code == TRANSACTION_NOT_FOUND
131+ # Error code differs between single server and cluster mode
132+ assert err .value .error_code in {BAD_PARAMETER , TRANSACTION_NOT_FOUND }
130133
131134
132135@pytest .mark .asyncio
0 commit comments