Bump httpx to 0.17.1 (#48388)

* Bump httpx to 0.17.1

* git add

* typing

* add test

* tweak
This commit is contained in:
J. Nick Koston 2021-03-26 22:02:01 -10:00 committed by GitHub
parent b50dcef94f
commit 79af18a8ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 4 deletions

View file

@ -80,6 +80,19 @@ async def test_get_async_client_patched_close(hass):
assert mock_aclose.call_count == 0
async def test_get_async_client_context_manager(hass):
"""Test using the async client with a context manager does not close the session."""
with patch("httpx.AsyncClient.aclose") as mock_aclose:
httpx_session = client.get_async_client(hass)
assert isinstance(hass.data[client.DATA_ASYNC_CLIENT], httpx.AsyncClient)
async with httpx_session:
pass
assert mock_aclose.call_count == 0
async def test_warning_close_session_integration(hass, caplog):
"""Test log warning message when closing the session from integration context."""
with patch(