Skip to content

Commit d043698

Browse files
ZeroIntensityseifertm
authored andcommitted
Switch to inspect.iscoroutinefunction over asyncio.iscoroutinefunction
1 parent aefe2f4 commit d043698

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pytest_asyncio/plugin.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def _make_asyncio_fixture_function(
176176

177177

178178
def _is_coroutine_or_asyncgen(obj: Any) -> bool:
179-
return asyncio.iscoroutinefunction(obj) or inspect.isasyncgenfunction(obj)
179+
return inspect.iscoroutinefunction(obj) or inspect.isasyncgenfunction(obj)
180180

181181

182182
def _get_asyncio_mode(config: Config) -> Mode:
@@ -447,7 +447,7 @@ class Coroutine(PytestAsyncioFunction):
447447
@staticmethod
448448
def _can_substitute(item: Function) -> bool:
449449
func = item.obj
450-
return asyncio.iscoroutinefunction(func)
450+
return inspect.iscoroutinefunction(func)
451451

452452
def runtest(self) -> None:
453453
self.obj = wrap_in_sync(
@@ -512,7 +512,7 @@ def _can_substitute(item: Function) -> bool:
512512
return (
513513
getattr(func, "is_hypothesis_test", False) # type: ignore[return-value]
514514
and getattr(func, "hypothesis", None)
515-
and asyncio.iscoroutinefunction(func.hypothesis.inner_test)
515+
and inspect.iscoroutinefunction(func.hypothesis.inner_test)
516516
)
517517

518518
def runtest(self) -> None:

0 commit comments

Comments
 (0)