Skip to content

PYTHON-4753 [Build Failure] Async tests missing awaits #1851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/asynchronous/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably replace these setName lines with client_context.replica_set_name.

set_name = async_client_context.replica_set_name
if set_name:
if not self.service_realm_required:
# Without authMechanismProperties
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions test/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Loading