-
Type:
Task
-
Resolution: Duplicate
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
sophiayangDB has created PR #2855: PYTHON-5796: Reduce insert_one({}) collection-priming calls in test suite in mongo-python-driver
Issue Text:
PYTHON-5796
-
- Changes in this PR
- Replace insert_one({}) with explicit create_collection() calls where the intent is solely to test against an existing collection
- When possible, add collection step to setUp/asyncSetUp on relevant base classes
-
-
- Code Audit of `insert_one({})`
159 total remaining (down from 183), a reduction of 24.
- Code Audit of `insert_one({})`
-
| File | Before (Sync/Async) | After (Sync/Async) | Instances Removed |
| — | — | — | — |
| test_index_management.py | 7 / 7 | 0 / 0 | 14 |
| test_collection.py | 5 / 5 | 1 / 1 | 8 |
| test_change_stream.py | 9 / 9 | 8 / 8 | 2 |
| test_sdam_monitoring_spec.py | 4 / 4 | 3 / 3 | 2 |
| test_session.py | 11 / 11 | 9 / 9 | 4 |
-
- Test Plan
Only modified test files.
- Test Plan
-
- Checklist
<!-- Do not delete the items provided on this checklist. -->
- Checklist
-
-
- Checklist for Author
-
- [ ] Did you update the changelog (if necessary)?
- [ ] Is there test coverage?
- [ ] Is any followup work tracked in a JIRA ticket? If so, add link(s).
-
-
- Checklist for Reviewer
-
- [ ] Does the title of the PR reference a JIRA Ticket?
- [ ] Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
- [ ] Is all relevant documentation (README or docstring) updated?