Skip to content

Commit 787a6db

Browse files
committed
Replace asyncio.iscoroutinefunction with inspect
Starting in Python 3.14, use of `asyncio.iscoroutinefunction` emits a deprecation warning (c.f. python/cpython#122858). The recommendation is to use inspect.iscoroutinefunction instead.
1 parent 59b572e commit 787a6db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
from unittest.mock import AsyncMock, MagicMock
1414
import urllib.parse
1515

16+
import inspect
17+
1618
import httpx
1719
import pytest
18-
import asyncio
1920
from functools import wraps
2021

2122
from tests.utils.client_configuration import ClientConfiguration
@@ -345,6 +346,6 @@ def sync_wrapper(*args, **kwargs):
345346
return func(*args, **kwargs)
346347

347348
# Return appropriate wrapper based on whether the function is async or not
348-
if asyncio.iscoroutinefunction(func):
349+
if inspect.iscoroutinefunction(func):
349350
return async_wrapper
350351
return sync_wrapper

0 commit comments

Comments
 (0)