From 9514a6727022d602cfd87bf74ebccd21023252dd Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Thu, 31 Jul 2025 08:54:12 -0400 Subject: [PATCH] PYTHON-5441 - Unskip gridfs download chunk tests (#2449) --- test/asynchronous/unified_format.py | 15 ++++++++++----- test/unified_format.py | 15 ++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/test/asynchronous/unified_format.py b/test/asynchronous/unified_format.py index b9cebd0fa..964d2df96 100644 --- a/test/asynchronous/unified_format.py +++ b/test/asynchronous/unified_format.py @@ -519,6 +519,15 @@ class UnifiedSpecTestMixinV1(AsyncIntegrationTest): 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 @@ class UnifiedSpecTestMixinV1(AsyncIntegrationTest): 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 @@ -982,13 +991,9 @@ class UnifiedSpecTestMixinV1(AsyncIntegrationTest): 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 2c10506fc..c21f29fe1 100644 --- a/test/unified_format.py +++ b/test/unified_format.py @@ -518,6 +518,15 @@ class UnifiedSpecTestMixinV1(IntegrationTest): 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 @@ class UnifiedSpecTestMixinV1(IntegrationTest): 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 @@ -973,13 +982,9 @@ class UnifiedSpecTestMixinV1(IntegrationTest): 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}')