pytest-dev / pytest-asyncio

Asyncio support for pytest
https://pytest-asyncio.readthedocs.io
Apache License 2.0
1.43k stars 152 forks source link

Use of deprecated `asyncio.iscoroutinefunction` #929

Closed ZeroIntensity closed 2 months ago

ZeroIntensity commented 2 months ago

asyncio.iscoroutinefunction is the same as inspect.iscoroutinefunction (since it's conception, I think), and is deprecated on 3.14 (IIRC, the plan is to remove it in 3.16).

It's used in a few places, such as here https://github.com/pytest-dev/pytest-asyncio/blob/cf106746984664805fcff1a2f62cb421b2908560/pytest_asyncio/plugin.py#L179

I have a PR ready to switch things over to inspect.iscoroutinefunction -- since they're exactly the same, this won't break anything (and saves you guys a headache a few years down the line :smile:)

seifertm commented 2 months ago

I wasn't aware of the deprecation, but it absolutely makes sense.

Thanks @ZeroIntensity!