-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-4733 Migrate test_auth.py to async #1838
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
so...i'm honestly not sure what I did to this commit history HAHA I was just trying to rebase my branch.. |
Can you undo the rebase and merge master into the un-rebased branch? There's changes already in master that show up in this PR. |
141b9ae
to
b915418
Compare
I think I did it correctly? |
test/test_auth.py
Outdated
self.success = True | ||
else: | ||
|
||
def _run_async(): |
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.
Any threading test needs to be skipped for async because async client doesn't support multithreading.
test/test_auth.py
Outdated
@@ -204,6 +215,8 @@ def test_gssapi_simple(self): | |||
|
|||
@ignore_deprecations | |||
def test_gssapi_threaded(self): | |||
if not _IS_SYNC: |
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.
Use @async_client_context.require_sync
as a decorator for sync-only tests instead.
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.
cool cool, didn't know about this! thanks!
test/test_auth.py
Outdated
@@ -579,6 +594,8 @@ def test_cache(self): | |||
self.assertIsInstance(iterations, int) | |||
|
|||
def test_scram_threaded(self): | |||
if not _IS_SYNC: |
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.
Same here.
test/test_auth.py
Outdated
@@ -74,8 +77,16 @@ def __init__(self, collection): | |||
self.success = False | |||
|
|||
def run(self): | |||
assert self.collection.find_one({"$where": delay(1)}) is not None | |||
self.success = True | |||
if _IS_SYNC: |
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.
Since the async client doesn't support multithreading, we don't need to have AutoAuthenticateThread
support async.
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.
Great work!
No description provided.