-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5079 Convert test.test_dns to async #2096
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
Conversation
test/asynchronous/test_dns.py
Outdated
# tests. | ||
copts["tlsAllowInvalidHostnames"] = True | ||
|
||
client = AsyncPyMongoTestCase.unmanaged_simple_client(uri, **copts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client = AsyncPyMongoTestCase.unmanaged_simple_client(uri, **copts) | |
client = self.simple_client(uri, **copts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we decide when to use helper methods vs the unmanaged clients?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally you should always use helper methods unless we need a client somewhere entirely out of a unittest class context. Those situations should be very rare in our test suites.
test/asynchronous/test_dns.py
Outdated
await client.admin.command("ping") | ||
# XXX: we should block until SRV poller runs at least once | ||
# and re-run these assertions. | ||
await client.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed since our clients are closed automatically when using the helper methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, make sense :)
No description provided.