From 9ff5a1755cb626c62fd4f61ea4950c4655a4f301 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 31 Mar 2025 19:26:18 -0500 Subject: [PATCH] PYTHON-3674 Simplify transaction options in convenient API doc example code (#2230) --- test/asynchronous/test_examples.py | 7 +------ test/test_examples.py | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/test/asynchronous/test_examples.py b/test/asynchronous/test_examples.py index 1312f1e21..9e9b208f5 100644 --- a/test/asynchronous/test_examples.py +++ b/test/asynchronous/test_examples.py @@ -1163,12 +1163,7 @@ class TestTransactionExamples(AsyncIntegrationTest): # Step 2: Start a client session. async with client.start_session() as session: # Step 3: Use with_transaction to start a transaction, execute the callback, and commit (or abort on error). - await session.with_transaction( - callback, - read_concern=ReadConcern("local"), - write_concern=wc_majority, - read_preference=ReadPreference.PRIMARY, - ) + await session.with_transaction(callback) # End Transactions withTxn API Example 1 diff --git a/test/test_examples.py b/test/test_examples.py index ef06a77b9..28fe1beaf 100644 --- a/test/test_examples.py +++ b/test/test_examples.py @@ -1161,12 +1161,7 @@ class TestTransactionExamples(IntegrationTest): # Step 2: Start a client session. with client.start_session() as session: # Step 3: Use with_transaction to start a transaction, execute the callback, and commit (or abort on error). - session.with_transaction( - callback, - read_concern=ReadConcern("local"), - write_concern=wc_majority, - read_preference=ReadPreference.PRIMARY, - ) + session.with_transaction(callback) # End Transactions withTxn API Example 1