Skip to content

PYTHON-6081 test_list_collections in test_typing.py fails when the test database is empty - #3056

Merged
sleepyStick merged 1 commit into
mongodb:mainfrom
sleepyStick:PYTHON-6081
Sep 15, 2026
Merged

sleepyStick merged 1 commit into
mongodb:mainfrom
sleepyStick:PYTHON-6081

Conversation

@sleepyStick

@sleepyStick sleepyStick commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

…st database is empty

PYTHON-6081

Changes in this PR

add collection prior to calling list collection to ensure that there is always at least one collection :)

Test Plan

typing tests pass when run in the same situation that caused it to fail before :)

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?

Copilot AI lite review requested due to automatic review settings September 15, 2026 17:25
@sleepyStick
sleepyStick requested a review from a team as a code owner September 15, 2026 17:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The test now handles empty databases and cleans up after itself.

Pull request overview

Fixes test_list_collections when the test database is empty.

Changes:

  • Creates a temporary collection before listing.
  • Cleans up the collection afterward.
File summaries
File Description
test/test_typing.py Makes the collection-listing test reliable and isolated.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@blink1073 blink1073 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sleepyStick
sleepyStick merged commit a6debc5 into mongodb:main Sep 15, 2026
91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants