-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DeprecationWarning in 3.8 #126
Comments
Worth noting that just changing to async-def's is not enough, as this will cause your current code base to produce RuntimeWarnings. Reason being that failing to await an asyncio.coroutine-marked function's coroutine does not produce a warning in Python3.7, but failing to await an async-def coroutine will. Python 3.7.3 (default, Jun 24 2019, 04:54:02)
[GCC 9.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>>
>>> @asyncio.coroutine
... def foo():
... pass
...
>>> f = foo()
>>> del f
>>>
>>> async def bar():
... pass
...
>>> b = bar()
>>> del b
__main__:1: RuntimeWarning: coroutine 'bar' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback I can put a pull request up with the main changes, but specifically, we have a few failures that appear to be because of this issue. Without knowing this code base any better, I am reluctant to do something that is against how you would like this code base to be designed :-) |
It's relatively easy to silence "never awaited" warnings: just add a dummy callback. |
@nekokatt please publish a wip PR and maybe someone else will poke at it? |
is this still needed? Python3.8 has AsyncMock in the standard lib now it appears |
That's a good question :) |
asynctest doesn't work with Python 3.8+, but AsyncMock() and few other parts are available in the standard library already. See Martiusweb/asynctest#144 and Martiusweb/asynctest#126
asynctest doesn't work with Python 3.8+, but AsyncMock() and few other parts are available in the standard library already. See Martiusweb/asynctest#144 and Martiusweb/asynctest#126
asynctest doesn't work with Python 3.8+, but AsyncMock() and few other parts are available in the standard library already. See Martiusweb/asynctest#144 and Martiusweb/asynctest#126 (cherry picked from commit 1a2ce72)
asyncio.coroutine is deprecated in python/cpython#13346 . Since 3.4 not supported maybe
async def
can be used? I ran pytest on CPython master and warnings as below :The text was updated successfully, but these errors were encountered: