PYTHON-5092 - Convert test.test_pooling to async#2145
Merged
NoahStapp merged 3 commits intomongodb:masterfrom Feb 13, 2025
Merged
PYTHON-5092 - Convert test.test_pooling to async#2145NoahStapp merged 3 commits intomongodb:masterfrom
NoahStapp merged 3 commits intomongodb:masterfrom
Conversation
sleepyStick
reviewed
Feb 12, 2025
test/asynchronous/test_pooling.py
Outdated
| await db.test.insert_many([{} for _ in range(10)]) | ||
|
|
||
| async def asyncTearDown(self): | ||
| await self.c.close() |
Contributor
There was a problem hiding this comment.
is this self.c.close() needed? I thought async_rs_or_single_client() would close it?
Contributor
Author
There was a problem hiding this comment.
Good catch! Removed.
ShaneHarvey
reviewed
Feb 12, 2025
| """Test built in connection-pooling with threads.""" | ||
| from __future__ import annotations | ||
|
|
||
| import asyncio |
Member
There was a problem hiding this comment.
I thought synchro.py was supposed to remove asyncio imports?
Contributor
Author
There was a problem hiding this comment.
It doesn't remove asyncio imports. We still have some files that have _IS_SYNC branches that make use of asyncio.
test/test_pooling.py
Outdated
| import sys | ||
| import threading | ||
| import time | ||
| from test.helpers import ConcurrentRunner |
Member
There was a problem hiding this comment.
please move this down next to the other test imports.
ShaneHarvey
approved these changes
Feb 13, 2025
sleepyStick
approved these changes
Feb 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.