From c0e0554a3b69b7c3140a792934682c19b43fc269 Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Wed, 3 Sep 2025 14:18:51 -0400 Subject: [PATCH] PYTHON-5521 - Update TestBsonSizeBatches.test_06_insert_fails_over_16MiB error codes (#2515) --- test/asynchronous/test_encryption.py | 2 +- test/test_encryption.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/asynchronous/test_encryption.py b/test/asynchronous/test_encryption.py index 337dba0f6..4517c9f91 100644 --- a/test/asynchronous/test_encryption.py +++ b/test/asynchronous/test_encryption.py @@ -1268,7 +1268,7 @@ class TestBsonSizeBatches(AsyncEncryptionIntegrationTest): with self.assertRaises(BulkWriteError) as ctx: await self.coll_encrypted.bulk_write([InsertOne(doc)]) err = ctx.exception.details["writeErrors"][0] - self.assertEqual(2, err["code"]) + self.assertIn(err["code"], [2, 10334]) self.assertIn("object to insert too large", err["errmsg"]) diff --git a/test/test_encryption.py b/test/test_encryption.py index 46d8c785c..fb18cc2dd 100644 --- a/test/test_encryption.py +++ b/test/test_encryption.py @@ -1264,7 +1264,7 @@ class TestBsonSizeBatches(EncryptionIntegrationTest): with self.assertRaises(BulkWriteError) as ctx: self.coll_encrypted.bulk_write([InsertOne(doc)]) err = ctx.exception.details["writeErrors"][0] - self.assertEqual(2, err["code"]) + self.assertIn(err["code"], [2, 10334]) self.assertIn("object to insert too large", err["errmsg"])