diff --git a/tenacity/_asyncio.py b/tenacity/_asyncio.py
index f93bf0f..035699d 100644
--- a/tenacity/_asyncio.py
+++ b/tenacity/_asyncio.py
@@ -38,6 +38,12 @@ if asyncio:
             super(AsyncRetrying, self).__init__(**kwargs)
             self.sleep = sleep
 
+        def wraps(self, fn):
+            fn = super().wraps(fn)
+            # Ensure wrapper is recognized as a coroutine function.
+            fn._is_coroutine = asyncio.coroutines._is_coroutine
+            return fn
+
         @asyncio.coroutine
         def call(self, fn, *args, **kwargs):
             self.begin(fn)

Asyncio: iscoroutinefunction does not work with tenacity
When decorating an `async` function with `@retry`, `asyncio.iscoroutinefunction(f)` unexpectedly returns `False`, because the wrapping function, in fact, is no coroutine.

This is a problem in some libraries that are using this way of determining if they are handling an async function or not (in my case: trafaret).
diff --git a/tenacity/tests/test_asyncio.py b/tenacity/tests/test_asyncio.py
index 6937511..8a8d3ce 100644
--- a/tenacity/tests/test_asyncio.py
+++ b/tenacity/tests/test_asyncio.py
@@ -36,9 +36,8 @@ def asynctest(callable_):
 
 
 @retry
-@asyncio.coroutine
-def _retryable_coroutine(thing):
-    yield from asyncio.sleep(0.00001)
+async def _retryable_coroutine(thing):
+    await asyncio.sleep(0.00001)
     return thing.go()
 
 

pip install -e .[doc]
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
Babel==2.14.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
docutils==0.19
dulwich==0.22.1
exceptiongroup==1.2.2
idna==3.10
imagesize==1.4.1
importlib-metadata==6.7.0
iniconfig==2.0.0
Jinja2==3.1.6
MarkupSafe==2.1.5
packaging==24.0
pbr==6.1.1
pluggy==1.2.0
Pygments==2.17.2
pytest==7.4.4
pytz==2025.2
PyYAML==6.0.1
reno==4.1.0
requests==2.31.0
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
-e git+https://github.com/jd/tenacity.git@dcabb396a4b851da44d2fb6fed84d6540cc2d93c#egg=tenacity
tomli==2.0.1
tornado==6.2
typing_extensions==4.7.1
urllib3==2.0.7
zipp==3.15.0

name: tenacity
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - babel==2.14.0
      - charset-normalizer==3.4.1
      - docutils==0.19
      - dulwich==0.22.1
      - exceptiongroup==1.2.2
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - jinja2==3.1.6
      - markupsafe==2.1.5
      - packaging==24.0
      - pbr==6.1.1
      - pluggy==1.2.0
      - pygments==2.17.2
      - pytest==7.4.4
      - pytz==2025.2
      - pyyaml==6.0.1
      - reno==4.1.0
      - requests==2.31.0
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==2.0.1
      - tornado==6.2
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - zipp==3.15.0
prefix: /opt/conda/envs/tenacity

tenacity/tests/test_asyncio.py::TestAsync::test_retry
tenacity/tests/test_asyncio.py::TestAsync::test_attempt_number_is_correct_for_interleaved_coroutines tenacity/tests/test_asyncio.py::TestAsync::test_repr tenacity/tests/test_asyncio.py::TestAsync::test_stop_after_attempt
tenacity/_asyncio.py
tenacity/_asyncio.py