Skip to content

Commit f6d2fcd

Browse files
committed
fix coroutine function check
1 parent fb28f15 commit f6d2fcd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

test/asynchronous/test_comment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ async def _test_ops(
7070
else:
7171
if iscoroutinefunction(coll.create_index):
7272
await coll.create_index("a")
73-
maybe_cursor = await h(*args, **kwargs)
7473
else:
7574
coll.create_index("a")
75+
if iscoroutinefunction(h):
76+
maybe_cursor = await h(*args, **kwargs)
77+
else:
7678
maybe_cursor = h(*args, **kwargs)
7779
self.assertIn(
7880
"comment",

test/test_comment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ def _test_ops(
7070
else:
7171
if iscoroutinefunction(coll.create_index):
7272
coll.create_index("a")
73-
maybe_cursor = h(*args, **kwargs)
7473
else:
7574
coll.create_index("a")
75+
if iscoroutinefunction(h):
76+
maybe_cursor = h(*args, **kwargs)
77+
else:
7678
maybe_cursor = h(*args, **kwargs)
7779
self.assertIn(
7880
"comment",

0 commit comments

Comments
 (0)