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"])