From 57e14129bc281eabde0e6c8f642b9110fafaa205 Mon Sep 17 00:00:00 2001 From: Iris Date: Tue, 10 Sep 2024 15:02:58 -0700 Subject: [PATCH 1/2] PYTHON-4753 added parens around awaits --- test/asynchronous/test_auth.py | 6 +++--- test/test_auth.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/asynchronous/test_auth.py b/test/asynchronous/test_auth.py index e516ff6798..3b7dbf0f87 100644 --- a/test/asynchronous/test_auth.py +++ b/test/asynchronous/test_auth.py @@ -169,7 +169,7 @@ async def test_gssapi_simple(self): client = AsyncMongoClient(mech_uri) await client[GSSAPI_DB].collection.find_one() - set_name = await client.admin.command(HelloCompat.LEGACY_CMD).get("setName") + set_name = (await client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") if set_name: if not self.service_realm_required: # Without authMechanismProperties @@ -242,7 +242,7 @@ async def test_gssapi_threaded(self): thread.join() self.assertTrue(thread.success) - set_name = await client.admin.command(HelloCompat.LEGACY_CMD).get("setName") + set_name = (await client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") if set_name: client = AsyncMongoClient( GSSAPI_HOST, @@ -296,7 +296,7 @@ async def test_sasl_plain(self): client = AsyncMongoClient(uri) await client.ldap.test.find_one() - set_name = await client.admin.command(HelloCompat.LEGACY_CMD).get("setName") + set_name = (await client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") if set_name: client = AsyncMongoClient( SASL_HOST, diff --git a/test/test_auth.py b/test/test_auth.py index 0bf0cfd80f..ad7d8e15ed 100644 --- a/test/test_auth.py +++ b/test/test_auth.py @@ -169,7 +169,7 @@ def test_gssapi_simple(self): client = MongoClient(mech_uri) client[GSSAPI_DB].collection.find_one() - set_name = client.admin.command(HelloCompat.LEGACY_CMD).get("setName") + set_name = (client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") if set_name: if not self.service_realm_required: # Without authMechanismProperties @@ -242,7 +242,7 @@ def test_gssapi_threaded(self): thread.join() self.assertTrue(thread.success) - set_name = client.admin.command(HelloCompat.LEGACY_CMD).get("setName") + set_name = (client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") if set_name: client = MongoClient( GSSAPI_HOST, @@ -296,7 +296,7 @@ def test_sasl_plain(self): client = MongoClient(uri) client.ldap.test.find_one() - set_name = client.admin.command(HelloCompat.LEGACY_CMD).get("setName") + set_name = (client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") if set_name: client = MongoClient( SASL_HOST, From bb0d08e772129bdffc9cc9b0f485df9ea3cc3225 Mon Sep 17 00:00:00 2001 From: Iris Date: Wed, 11 Sep 2024 10:07:50 -0700 Subject: [PATCH 2/2] change how set_name is set --- test/asynchronous/test_auth.py | 6 +++--- test/test_auth.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/asynchronous/test_auth.py b/test/asynchronous/test_auth.py index 3b7dbf0f87..06f7fb9ca8 100644 --- a/test/asynchronous/test_auth.py +++ b/test/asynchronous/test_auth.py @@ -169,7 +169,7 @@ async def test_gssapi_simple(self): client = AsyncMongoClient(mech_uri) await client[GSSAPI_DB].collection.find_one() - set_name = (await client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") + set_name = async_client_context.replica_set_name if set_name: if not self.service_realm_required: # Without authMechanismProperties @@ -242,7 +242,7 @@ async def test_gssapi_threaded(self): thread.join() self.assertTrue(thread.success) - set_name = (await client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") + set_name = async_client_context.replica_set_name if set_name: client = AsyncMongoClient( GSSAPI_HOST, @@ -296,7 +296,7 @@ async def test_sasl_plain(self): client = AsyncMongoClient(uri) await client.ldap.test.find_one() - set_name = (await client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") + set_name = async_client_context.replica_set_name if set_name: client = AsyncMongoClient( SASL_HOST, diff --git a/test/test_auth.py b/test/test_auth.py index ad7d8e15ed..fa3d0905bb 100644 --- a/test/test_auth.py +++ b/test/test_auth.py @@ -169,7 +169,7 @@ def test_gssapi_simple(self): client = MongoClient(mech_uri) client[GSSAPI_DB].collection.find_one() - set_name = (client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") + set_name = client_context.replica_set_name if set_name: if not self.service_realm_required: # Without authMechanismProperties @@ -242,7 +242,7 @@ def test_gssapi_threaded(self): thread.join() self.assertTrue(thread.success) - set_name = (client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") + set_name = client_context.replica_set_name if set_name: client = MongoClient( GSSAPI_HOST, @@ -296,7 +296,7 @@ def test_sasl_plain(self): client = MongoClient(uri) client.ldap.test.find_one() - set_name = (client.admin.command(HelloCompat.LEGACY_CMD)).get("setName") + set_name = client_context.replica_set_name if set_name: client = MongoClient( SASL_HOST,