From 9e5ab1b5b99b68922beea29b65c2ceedca781881 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Tue, 22 Jun 2021 17:25:05 -0700 Subject: [PATCH] PYTHON-2764 Fix unified test coerce_result on unack writes (#652) (cherry picked from commit 3ef01179a24d1df22ceb37b85e509aad88db9cf9) --- test/unified_format.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/unified_format.py b/test/unified_format.py index ec32a5913..22a90fb6b 100644 --- a/test/unified_format.py +++ b/test/unified_format.py @@ -614,6 +614,8 @@ class MatchEvaluatorUtil(object): def coerce_result(opname, result): """Convert a pymongo result into the spec's result format.""" + if hasattr(result, 'acknowledged') and not result.acknowledged: + return {'acknowledged': False} if opname == 'bulkWrite': return parse_bulk_write_result(result) if opname == 'insertOne':