Bump httpx to 0.17.1 (#48388)
* Bump httpx to 0.17.1 * git add * typing * add test * tweak
This commit is contained in:
parent
b50dcef94f
commit
79af18a8ab
5 changed files with 28 additions and 4 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue