-
Type:
Bug
-
Resolution: Done
-
Priority:
Critical - P2
-
None
-
Affects Version/s: None
-
Component/s: Tests
-
None
-
Python Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Detailed steps to reproduce the problem?
TestPymongo.test_list_collections in test_typing.py calls next() unconditionally:
cursor = self.client.test.list_collections() value = cursor.next()
next() raises StopIteration whenever self.client.test has no collections. Whether it has any depends on what ran earlier in the same process. The test fails when run alone, or in any run where no earlier test created a collection in the test database. This surfaced on the Python 3.15t coverage task in PYTHON-6077, but the bug is not version-specific.
test_list_databases is safe because list_databases() always returns at least one database.
Definition of done: what must be done to consider the task complete?
test_list_collections guarantees a non-empty result before calling next(), matching test_default_document_type (for example, insert a document first, then list collections).
The exact Python version used, with patch level:
N/A - not version-specific.
The exact version of PyMongo used, with patch level:
N/A.
Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.
Empty test database. Otherwise N/A.
The operating system and version (e.g. Windows 7, OSX 10.8, ...)
N/A.
Web framework or asynchronous network library used, if any, with version (e.g. Django 1.7, mod_wsgi 4.3.0, gevent 1.0.1, Tornado 4.0.2, ...)
N/A.
Security Vulnerabilities
If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions [here|https://www.mongodb.com/docs/manual/tutorial/create-a-vulnerability-report/]
- blocks
-
PYTHON-6077 Officially support Python 3.15
-
- Blocked
-