Skip to content

Commit 33ff947

Browse files
committed
update test
1 parent a0eae81 commit 33ff947

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/asynchronous/test_transactions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,12 @@ async def test_case_1(self):
594594
# Instantiate a collection object in the driver with a default write concern of { w: 0 }.
595595
inner_coll = coll.with_options(write_concern=WriteConcern(w=0))
596596
# Insert the document { n: 1 } on the instantiated collection.
597-
inner_coll.insert_one({"n": 1}, session=s)
597+
result = await inner_coll.insert_one({"n": 1}, session=s)
598598
# Commit the transaction.
599599
await s.commit_transaction()
600600
# End the session.
601601
# Ensure the document was inserted and no error was thrown from the transaction.
602-
assert (await coll.find_one({"n": 1})) is not None
602+
assert result.inserted_id is not None
603603

604604

605605
if __name__ == "__main__":

test/test_transactions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,12 @@ def test_case_1(self):
582582
# Instantiate a collection object in the driver with a default write concern of { w: 0 }.
583583
inner_coll = coll.with_options(write_concern=WriteConcern(w=0))
584584
# Insert the document { n: 1 } on the instantiated collection.
585-
inner_coll.insert_one({"n": 1}, session=s)
585+
result = inner_coll.insert_one({"n": 1}, session=s)
586586
# Commit the transaction.
587587
s.commit_transaction()
588588
# End the session.
589589
# Ensure the document was inserted and no error was thrown from the transaction.
590-
assert (coll.find_one({"n": 1})) is not None
590+
assert result.inserted_id is not None
591591

592592

593593
if __name__ == "__main__":

0 commit comments

Comments
 (0)