Skip to content

Commit 7724a9e

Browse files
authored
Replace asyncio.iscoroutinefunction with inspect.iscoroutinefunction (#469)
DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead Fixes #468
1 parent 51bebd3 commit 7724a9e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/pytest_mock/plugin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import asyncio
21
import builtins
32
import functools
43
import inspect
@@ -196,7 +195,7 @@ async def async_wrapper(*args, **kwargs):
196195
spy_obj.spy_return_list.append(r)
197196
return r
198197

199-
if asyncio.iscoroutinefunction(method):
198+
if inspect.iscoroutinefunction(method):
200199
wrapped = functools.update_wrapper(async_wrapper, method)
201200
else:
202201
wrapped = functools.update_wrapper(wrapper, method)

0 commit comments

Comments
 (0)