Skip to content

Commit 2b4797e

Browse files
committed
jk wasn't extra, need to check, sometimes its need and sometimes its not
1 parent 0ecdd31 commit 2b4797e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

test/asynchronous/test_comment.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ async def _test_ops(
6868
await coll.insert_one({})
6969
maybe_cursor = await db.validate_collection(*args, **kwargs)
7070
else:
71-
coll.create_index("a")
72-
if iscoroutinefunction(h):
71+
if iscoroutinefunction(coll.create_index):
72+
await coll.create_index("a")
7373
maybe_cursor = await h(*args, **kwargs)
7474
else:
75+
coll.create_index("a")
7576
maybe_cursor = h(*args, **kwargs)
7677
self.assertIn(
7778
"comment",

test/test_comment.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ def _test_ops(
6868
coll.insert_one({})
6969
maybe_cursor = db.validate_collection(*args, **kwargs)
7070
else:
71-
coll.create_index("a")
71+
if iscoroutinefunction(coll.create_index):
72+
coll.create_index("a")
73+
else:
74+
coll.create_index("a")
7275
if iscoroutinefunction(h):
7376
maybe_cursor = h(*args, **kwargs)
7477
else:

0 commit comments

Comments
 (0)