From 5e45cd8c649f9c1ed9baa7fe0ea35abf5b958fcb Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Mon, 4 Nov 2024 08:02:47 -0500 Subject: [PATCH] PYTHON-4941 - Fix Synchronous unified test runner being used in asynchronous tests --- test/asynchronous/test_auth_spec.py | 2 +- test/asynchronous/test_change_stream.py | 2 +- test/asynchronous/test_connection_logging.py | 2 +- test/asynchronous/test_crud_unified.py | 2 +- test/asynchronous/test_encryption.py | 2 +- test/asynchronous/unified_format.py | 2 +- test/unified_format.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/asynchronous/test_auth_spec.py b/test/asynchronous/test_auth_spec.py index a6ab1cb331..e9e43d5759 100644 --- a/test/asynchronous/test_auth_spec.py +++ b/test/asynchronous/test_auth_spec.py @@ -25,7 +25,7 @@ sys.path[0:0] = [""] from test import unittest -from test.unified_format import generate_test_classes +from test.asynchronous.unified_format import generate_test_classes from pymongo import AsyncMongoClient from pymongo.asynchronous.auth_oidc import OIDCCallback diff --git a/test/asynchronous/test_change_stream.py b/test/asynchronous/test_change_stream.py index 98641f46ee..8e16fe7528 100644 --- a/test/asynchronous/test_change_stream.py +++ b/test/asynchronous/test_change_stream.py @@ -35,7 +35,7 @@ async_client_context, unittest, ) -from test.unified_format import generate_test_classes +from test.asynchronous.unified_format import generate_test_classes from test.utils import ( AllowListEventListener, EventListener, diff --git a/test/asynchronous/test_connection_logging.py b/test/asynchronous/test_connection_logging.py index 6bc9835b70..945c6c59b5 100644 --- a/test/asynchronous/test_connection_logging.py +++ b/test/asynchronous/test_connection_logging.py @@ -22,7 +22,7 @@ sys.path[0:0] = [""] from test import unittest -from test.unified_format import generate_test_classes +from test.asynchronous.unified_format import generate_test_classes _IS_SYNC = False diff --git a/test/asynchronous/test_crud_unified.py b/test/asynchronous/test_crud_unified.py index 3d8deb36e9..e6f42d5bdf 100644 --- a/test/asynchronous/test_crud_unified.py +++ b/test/asynchronous/test_crud_unified.py @@ -22,7 +22,7 @@ sys.path[0:0] = [""] from test import unittest -from test.unified_format import generate_test_classes +from test.asynchronous.unified_format import generate_test_classes _IS_SYNC = False diff --git a/test/asynchronous/test_encryption.py b/test/asynchronous/test_encryption.py index e42c85aa7a..767b3ecf0a 100644 --- a/test/asynchronous/test_encryption.py +++ b/test/asynchronous/test_encryption.py @@ -46,6 +46,7 @@ unittest, ) from test.asynchronous.test_bulk import AsyncBulkTestBase +from test.asynchronous.unified_format import generate_test_classes from test.asynchronous.utils_spec_runner import AsyncSpecRunner from test.helpers import ( AWS_CREDS, @@ -56,7 +57,6 @@ KMIP_CREDS, LOCAL_MASTER_KEY, ) -from test.unified_format import generate_test_classes from test.utils import ( AllowListEventListener, OvertCommandListener, diff --git a/test/asynchronous/unified_format.py b/test/asynchronous/unified_format.py index b382db474f..f8179dc0c7 100644 --- a/test/asynchronous/unified_format.py +++ b/test/asynchronous/unified_format.py @@ -862,7 +862,7 @@ async def _clientEncryptionOperation_createDataKey(self, target, *args, **kwargs return await target.create_data_key(*args, **kwargs) async def _clientEncryptionOperation_getKeys(self, target, *args, **kwargs): - return await (await target.get_keys(*args, **kwargs)).to_list() + return await target.get_keys(*args, **kwargs).to_list() async def _clientEncryptionOperation_deleteKey(self, target, *args, **kwargs): result = await target.delete_key(*args, **kwargs) diff --git a/test/unified_format.py b/test/unified_format.py index 0da6168303..80c37470e3 100644 --- a/test/unified_format.py +++ b/test/unified_format.py @@ -858,7 +858,7 @@ def _clientEncryptionOperation_createDataKey(self, target, *args, **kwargs): return target.create_data_key(*args, **kwargs) def _clientEncryptionOperation_getKeys(self, target, *args, **kwargs): - return (target.get_keys(*args, **kwargs)).to_list() + return target.get_keys(*args, **kwargs).to_list() def _clientEncryptionOperation_deleteKey(self, target, *args, **kwargs): result = target.delete_key(*args, **kwargs)