Skip to content

Commit c200c2c

Browse files
authored
PYTHON-1658 Test that transaction reads ignore db/collection readConcern (mongodb#384)
Fix: properly skip tests that include 'skipReason'. Revendor transaction spec tests at commit 367842f1ee4b80f75664a05c6b9d5b2498cf856d
1 parent b1fc024 commit c200c2c

File tree

5 files changed

+785
-4
lines changed

5 files changed

+785
-4
lines changed

test/test_transactions.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ def end_sessions(sessions):
391391

392392
def create_test(scenario_def, test):
393393
def run_scenario(self):
394+
if test.get('skipReason'):
395+
raise unittest.SkipTest(test.get('skipReason'))
396+
394397
listener = OvertCommandListener()
395398
# New client, to avoid interference from pooled sessions.
396399
# Convert test['clientOptions'] to dict to avoid a Jython bug using "**"
@@ -561,10 +564,6 @@ def create_tests():
561564

562565
new_test = create_test(scenario_def, test)
563566
new_test = client_context.require_transactions(new_test)
564-
new_test = client_context._require(
565-
lambda: not test.get('skipReason'),
566-
test.get('skipReason'),
567-
new_test)
568567

569568
if 'secondary' in test_name:
570569
new_test = client_context._require(

test/transactions/bulk.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
},
185185
"result": {
186186
"deletedCount": 4,
187+
"insertedCount": 6,
187188
"insertedIds": {
188189
"0": 1,
189190
"3": 3,

test/transactions/error-labels.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@
595595
}
596596
}
597597
],
598+
"cursor": {},
598599
"readConcern": null,
599600
"lsid": "session0",
600601
"txnNumber": {

0 commit comments

Comments
 (0)