PYTHON-5796: Reduce insert_one({}) collection-priming calls in test suite#2855
PYTHON-5796: Reduce insert_one({}) collection-priming calls in test suite#2855sophiayangDB wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
MacOS test failures are unrelated |
| async def test_case_1(self): | ||
| """Driver can successfully create and list search indexes.""" | ||
|
|
||
| # Create a collection with the "create" command using a randomly generated name (referred to as ``coll0``). |
There was a problem hiding this comment.
hmm i think we need to keep the randomly generated name cuz that's what the spec test says (https://github.com/mongodb/specifications/blob/master/source/index-management/tests/README.md#case-1-driver-can-successfully-create-and-list-search-indexes)
There was a problem hiding this comment.
ah, i see its been moved to the setup,, can we either this comment up with the line of code maybe?
| await self.client.pymongo_test.create_collection("test") | ||
|
|
||
| async def asyncTearDown(self): | ||
| await self.client.pymongo_test.drop_collection("test") |
There was a problem hiding this comment.
nit pick / minor comment: does the drop collection need to be here if its also already done in the asyncSetup?
There was a problem hiding this comment.
Oh good point, I don't think it does.
| self.db.test.find_raw_batches()[0] | ||
|
|
||
| def test_collation(self): | ||
| self.db.test.insert_one({}) |
There was a problem hiding this comment.
silly question: should this be a create collection?
There was a problem hiding this comment.
We need at least one document since the next line calls next(), an empty collection would error.
PYTHON-5796
Changes in this PR
insert_one({})with explicitcreate_collection()calls where the intent is solely to test against an existing collectionTest Plan
Only modified test files.
Checklist
Checklist for Author
Checklist for Reviewer