Aiohttp: RuntimeWarning: coroutine 'noop' was never awaited

Created on 27 Oct 2019  路  5Comments  路  Source: aio-libs/aiohttp

Long story short

I get this when I run pytest with -s.

Apparently it was already noticed and dealt with here:
https://github.com/aio-libs/aiohttp/blob/f30a2043bb7e45d3ac775612c20c6e453f7c60f6/aiohttp/helpers.py#L103-L104

Expected behaviour

No warnings

Actual behaviour

Warnings

Steps to reproduce

The following test:
python -m pytest tests/test_web_functional.py::test_subapp_reverse_static_url[pyloop] -x -s

Your environment

I get it in python3.7 and python3.8.
Linux Mint 18.3
On aiohttp master

Any suggestions on how do fix it?
Maybe a sync and async version of noop?
I can make a pull request.

Most helpful comment

Got the same issue with aiohttp 4.0.0a1 Python 3.7.2 on MacOS:

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aiohttp/client.py:977:
RuntimeWarning: coroutine 'noop' was never awaited
  self._resp.release()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

The application works, but the warnings are there.

Is there a way to handle or silence this (apart from downgrading back to 3.6.x)? Really looking forward to getting it fixed! Will be happy to provide more info if needed, just lmk.

All 5 comments

Something similar here: #4177

I think we need noop class with __await__ method.
@AtomsForPeace would you work on it?

Sure thing!

Got the same issue with aiohttp 4.0.0a1 Python 3.7.2 on MacOS:

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aiohttp/client.py:977:
RuntimeWarning: coroutine 'noop' was never awaited
  self._resp.release()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

The application works, but the warnings are there.

Is there a way to handle or silence this (apart from downgrading back to 3.6.x)? Really looking forward to getting it fixed! Will be happy to provide more info if needed, just lmk.

Fixed by #4322

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amsb picture amsb  路  3Comments

deckar01 picture deckar01  路  4Comments

thehesiod picture thehesiod  路  4Comments

yuval-lb picture yuval-lb  路  5Comments

Smosker picture Smosker  路  3Comments