consul
consul copied to clipboard
[consul.aio] ClientSession.close was never awaited
Overview of the Issue
During teardown, consul tries to close the active session but since ClientSession.close
is in async function, it has to be awaited in order for the session to be closed.
Reproduction Steps
# script.py
from consul.aio import Consul
client = Consul()
After running this script, you'll run into the following warning:
RuntimeWarning: coroutine 'ClientSession.close' was never awaited
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fb609145b80>