Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pymongo/client_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ def abort_transaction(self):
pass
finally:
self._transaction.state = _TxnState.ABORTED
self._unpin_mongos()

def _finish_transaction_with_retry(self, command_name):
"""Run commit or abort with one retry after any retryable error.
Expand Down
13 changes: 10 additions & 3 deletions test/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@
wait_until, OvertCommandListener,
TestCreator)
from test.utils_spec_runner import SpecRunner
from test.unified_format import generate_test_classes

# Location of JSON test specifications.
_TEST_PATH = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'transactions')
TEST_PATH = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'transactions', 'legacy')
UNIFIED_TEST_PATH = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'transactions', 'unified')

_TXN_TESTS_DEBUG = os.environ.get('TRANSACTION_TESTS_DEBUG')

Expand Down Expand Up @@ -466,13 +469,17 @@ def run_scenario(self):
return run_scenario


test_creator = TestCreator(create_test, TestTransactions, _TEST_PATH)
test_creator = TestCreator(create_test, TestTransactions, TEST_PATH)
test_creator.create_tests()


TestCreator(create_test, TestTransactionsConvenientAPI,
TestTransactionsConvenientAPI.TEST_PATH).create_tests()


# Generate unified tests.
globals().update(generate_test_classes(UNIFIED_TEST_PATH, module=__name__))


if __name__ == "__main__":
unittest.main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading