Skip to content

Commit

Permalink
Replace asyncio.iscoroutinefunction with inspect.iscoroutinefunction
Browse files Browse the repository at this point in the history
DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead

Fixes #468
  • Loading branch information
hroncok committed Oct 24, 2024
1 parent 3e4d949 commit fb45484
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/pytest_mock/plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
import builtins
import functools
import inspect
Expand Down Expand Up @@ -196,7 +195,7 @@ async def async_wrapper(*args, **kwargs):
spy_obj.spy_return_list.append(r)
return r

if asyncio.iscoroutinefunction(method):
if inspect.iscoroutinefunction(method):
wrapped = functools.update_wrapper(async_wrapper, method)
else:
wrapped = functools.update_wrapper(wrapper, method)
Expand Down

0 comments on commit fb45484

Please sign in to comment.