Skip to content

Commit 2f2536c

Browse files
committed
Clearer tests
1 parent 847e534 commit 2f2536c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

test/performance/async_perf_test.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
from bson import encode
6262
from gridfs import AsyncGridFSBucket
6363
from pymongo import (
64-
AsyncMongoClient,
6564
DeleteOne,
6665
InsertOne,
6766
ReplaceOne,
@@ -217,14 +216,12 @@ async def do_task(self):
217216
class TestRunCommand8Tasks(TestRunCommand):
218217
n_tasks = 8
219218

220-
async def do_task(self):
221-
command = self.client.perftest.command
222-
await asyncio.gather(*[command("hello", True) for _ in range(NUM_DOCS)])
223-
224219

225220
class TestRunCommand80Tasks(TestRunCommand):
226221
n_tasks = 80
227222

223+
224+
class TestRunCommandManyTasks(TestRunCommand):
228225
async def do_task(self):
229226
command = self.client.perftest.command
230227
await asyncio.gather(*[command("hello", True) for _ in range(NUM_DOCS)])
@@ -281,14 +278,12 @@ async def do_task(self):
281278
class TestFindOneByID8Tasks(TestFindOneByID):
282279
n_tasks = 8
283280

284-
async def do_task(self):
285-
find_one = self.corpus.find_one
286-
await asyncio.gather(*[find_one({"_id": _id}) for _id in self.inserted_ids])
287-
288281

289282
class TestFindOneByID80Tasks(TestFindOneByID):
290283
n_tasks = 80
291284

285+
286+
class TestFindOneByIDManyTasks(TestFindOneByID):
292287
async def do_task(self):
293288
find_one = self.corpus.find_one
294289
await asyncio.gather(*[find_one({"_id": _id}) for _id in self.inserted_ids])
@@ -348,6 +343,10 @@ class TestFindManyAndEmptyCursor80Tasks(TestFindManyAndEmptyCursor):
348343
n_tasks = 80
349344

350345

346+
class TestFindManyAndEmptyCursorManyTasks(TestFindManyAndEmptyCursor):
347+
n_tasks = 1000
348+
349+
351350
class TestSmallDocBulkInsert(SmallDocInsertTest, AsyncPyMongoTestCase):
352351
async def do_task(self):
353352
await self.corpus.insert_many(self.documents, ordered=True)

0 commit comments

Comments
 (0)