-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
PYTHON-4731 - Explicitly close all MongoClients opened during tests #1855
Merged
Merged
Changes from 17 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
d7d8ce8
PYTHON-3193 - Add ResourceWarning for unclosed MongoClients in __del__
NoahStapp f5fbeef
Fix typecheck
NoahStapp 2bac24c
Address review
NoahStapp c9f99a0
Add traceback
NoahStapp 2fcf40b
WIP - done with test_client
NoahStapp d45a8c7
All async tests converted
NoahStapp 4ddb75e
WIP all
NoahStapp 2f5e9f5
All warnings fixed
NoahStapp 96519b8
Reduce test_client diff
NoahStapp 2c9da45
WIP
NoahStapp 3f7dce5
Cleanup
NoahStapp 4df385c
Cleanup part 2
NoahStapp 772dcf0
Fix failures
NoahStapp 1ea15cb
More fixes
NoahStapp 0512fa0
Use simple_client instead of raw clients
NoahStapp 55e12cb
More DNS fixes
NoahStapp a27c852
Fix test_cleanup_executors_on_client_del
NoahStapp a54d4e3
Remove source reference from MongoClient.__del__
NoahStapp 9cf059b
Fix test_srv_polling
NoahStapp ab018d7
More test fixes
NoahStapp a41e554
More fixes
NoahStapp b899e64
More fixes
NoahStapp 6455959
Merge branch 'master' into PYTHON-4731
NoahStapp 58aeb16
Fix change stream tests
NoahStapp 62d2716
Fix oidc and ocsp tests
NoahStapp 0f67b0d
More fixes
NoahStapp 06b5d0e
More fixes
NoahStapp 12732a6
Fixes woo
NoahStapp a770fd1
Fixes
NoahStapp 4adcffd
Fix serverless
NoahStapp 0678a89
fixes
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 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 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 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 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.
I still think we should remove
source=self
here to prevent holding a strong reference to the client.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.
Good point, unless we think it's useful to provide the user with the instance of the unclosed client?
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.
By the time
__del__
is called, there's no guarantees about the state of the object.