Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add async methods in ASYNC_METHODS for AsyncCollection
  • Loading branch information
assigdev committed Oct 4, 2018
commit 4c246b869d874ee2035814e2f4f06aae6927db6d
20 changes: 19 additions & 1 deletion pytest_async_mongodb/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,27 @@ async def __aexit__(self, exc_type, exc, tb):
class AsyncCollection(AsyncClassMethod, mongomock.Collection):

ASYNC_METHODS = [
'find_one',
'find',
'find_one',
'find_one_and_delete',
'find_one_and_replace',
'find_one_and_update',
'find_and_modify',
'save',
'delete_one',
'delete_many',
'count',
'insert_one',
'insert_many',
'update_one',
'update_many',
'replace_one',
'count_documents',
'estimated_document_count',
'drop',
'create_index',
'ensure_index',
'map_reduce',
]

async def find_one(self, filter=None, *args, **kwargs):
Expand Down