mongo-python-driver - PR #2855: PYTHON-5796: Reduce insert_one({}) collection-priming calls in test suite

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Duplicate
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • 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

        1. 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
          1. Code Audit of `insert_one({})`
            159 total remaining (down from 183), a reduction of 24.
      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
        1. Test Plan
          Only modified test files.
        1. Checklist
          <!-- Do not delete the items provided on this checklist. -->
          1. 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).
          1. 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?

            Assignee:
            Unassigned
            Reporter:
            TPM Jira Automations Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: