From e99f46c17137bb81b5a2ed67e9f28781f2dd0c6c Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Wed, 30 Jul 2025 14:04:18 -0400 Subject: [PATCH 1/2] PYTHON-5441 - Unskip gridfs download chunk tests --- test/asynchronous/unified_format.py | 4 ---- test/unified_format.py | 4 ---- 2 files changed, 8 deletions(-) diff --git a/test/asynchronous/unified_format.py b/test/asynchronous/unified_format.py index b9cebd0fab..0e8b0b7373 100644 --- a/test/asynchronous/unified_format.py +++ b/test/asynchronous/unified_format.py @@ -982,13 +982,9 @@ async def run_entity_operation(self, spec): if ignore and isinstance(exc, (PyMongoError,)): return exc if expect_error: - if method_name == "_collectionOperation_bulkWrite": - self.skipTest("Skipping test pending PYTHON-4598") return self.process_error(exc, expect_error) raise else: - if method_name == "_collectionOperation_bulkWrite": - self.skipTest("Skipping test pending PYTHON-4598") if expect_error: self.fail(f'Excepted error {expect_error} but "{opname}" succeeded: {result}') diff --git a/test/unified_format.py b/test/unified_format.py index 2c10506fc0..1fd171a3c5 100644 --- a/test/unified_format.py +++ b/test/unified_format.py @@ -973,13 +973,9 @@ def run_entity_operation(self, spec): if ignore and isinstance(exc, (PyMongoError,)): return exc if expect_error: - if method_name == "_collectionOperation_bulkWrite": - self.skipTest("Skipping test pending PYTHON-4598") return self.process_error(exc, expect_error) raise else: - if method_name == "_collectionOperation_bulkWrite": - self.skipTest("Skipping test pending PYTHON-4598") if expect_error: self.fail(f'Excepted error {expect_error} but "{opname}" succeeded: {result}') From 584748a15d563ed60832d50bac85c3a1986e9ca5 Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Wed, 30 Jul 2025 14:53:55 -0400 Subject: [PATCH 2/2] Skip bulkWrite tests until PYTHON-4597 is implemented --- test/asynchronous/unified_format.py | 11 ++++++++++- test/unified_format.py | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/test/asynchronous/unified_format.py b/test/asynchronous/unified_format.py index 0e8b0b7373..964d2df96d 100644 --- a/test/asynchronous/unified_format.py +++ b/test/asynchronous/unified_format.py @@ -519,6 +519,15 @@ def maybe_skip_test(self, spec): self.skipTest("Implement PYTHON-1894") if "timeoutMS applied to entire download" in spec["description"]: self.skipTest("PyMongo's open_download_stream does not cap the stream's lifetime") + if any( + x in spec["description"] + for x in [ + "First insertOne is never committed", + "Second updateOne is never committed", + "Third updateOne is never committed", + ] + ): + self.skipTest("Implement PYTHON-4597") class_name = self.__class__.__name__.lower() description = spec["description"].lower() @@ -672,7 +681,7 @@ def process_error(self, exception, spec): self.match_evaluator.match_result(expect_result, result) else: self.fail( - f"expectResult can only be specified with {BulkWriteError} or {ClientBulkWriteException} exceptions" + f"expectResult can only be specified with {BulkWriteError} or {ClientBulkWriteException} exceptions, got {exception}" ) return exception diff --git a/test/unified_format.py b/test/unified_format.py index 1fd171a3c5..c21f29fe19 100644 --- a/test/unified_format.py +++ b/test/unified_format.py @@ -518,6 +518,15 @@ def maybe_skip_test(self, spec): self.skipTest("Implement PYTHON-1894") if "timeoutMS applied to entire download" in spec["description"]: self.skipTest("PyMongo's open_download_stream does not cap the stream's lifetime") + if any( + x in spec["description"] + for x in [ + "First insertOne is never committed", + "Second updateOne is never committed", + "Third updateOne is never committed", + ] + ): + self.skipTest("Implement PYTHON-4597") class_name = self.__class__.__name__.lower() description = spec["description"].lower() @@ -671,7 +680,7 @@ def process_error(self, exception, spec): self.match_evaluator.match_result(expect_result, result) else: self.fail( - f"expectResult can only be specified with {BulkWriteError} or {ClientBulkWriteException} exceptions" + f"expectResult can only be specified with {BulkWriteError} or {ClientBulkWriteException} exceptions, got {exception}" ) return exception