-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5055 - Convert test_client.py to unittest #2074
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
Closed
Closed
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
2b058a2
PYTHON-5044 - Successive AsyncMongoClients on a single loop always ti…
NoahStapp 45e74da
Only join executors on async
NoahStapp 0296c20
Remove unneeded reset_async_client_context
NoahStapp 266b0a3
Convert test_client to pytest
NoahStapp b6baf79
TestAsyncClientUnitTest done
NoahStapp cca705d
TestAsyncClientIntegrationTest converted
NoahStapp ae650e0
Asynchronous test_client.py done
NoahStapp 8402799
Fix fixture scopes
NoahStapp 048edf2
test_client.py conversion complete
NoahStapp 84211e7
Lots of cleanup
NoahStapp d3c053c
Fix pytest invocations
NoahStapp d2620be
Workflow updates for asyncio tests
NoahStapp 7ee03c9
Cleanup
NoahStapp b9d98c9
Typing fixes
NoahStapp 41fe61e
Fix supports_secondary_read_pref
NoahStapp 47b8c9d
Fix async pytest invocation for EG
NoahStapp 9e115be
Remove executor closes
NoahStapp 8602dde
Remove executor cancel from close
NoahStapp cc3f1ad
run-tests.sh fix for async
NoahStapp 46e7436
Merge branch 'master' into PYTHON-5036
NoahStapp d906c3b
Fix uv.lock
NoahStapp 8efa6ec
Remove mock.patch decorator
NoahStapp 26b1178
test_iteration regex
NoahStapp 9694239
run-tests.sh hacking for compatibility
NoahStapp 9c3939b
run-tests.sh should use arrays for arguments
NoahStapp 1a643c3
TEST_ARGS should also use array
NoahStapp 90b4693
Undo unintended test/__init__.py changes
NoahStapp 0791a8f
More run-tests.sh fixes
NoahStapp 3f1a86c
Errexit hacking
NoahStapp 077a1cb
Address review
NoahStapp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
What about coverage? Does that pick up both test runs automatically?
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.
The coverage runs pick up both test cases: https://spruce.mongodb.com/task/mongo_python_driver_test_rhel8_python3.9_cov_test_8.0_replica_set_noauth_ssl_sync_async_patch_dc182310dabff470dbbfc7da3c09eb6a4e08dfed_6797d0671d810000071bc171_25_01_27_18_28_57?execution=0&sortBy=STATUS&sortDir=ASC.
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 shows it's not working as expected. The second coverage run will overwrite the
.coverage
output file by default: https://coverage.readthedocs.io/en/7.6.10/cmd.html#data-fileThere 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.
Good catch, does it make sense to use
--append
on the second run to keep the single file?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.
The alternative would be to use a separate file with
COVERAGE_FILE
and thencoverage combine
the two.