mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Add SSLContext.set_default_verify_paths to asyncio blocking detection (#140648)
This one loads a significant number of files from /etc/ssl
This commit is contained in:
@@ -459,3 +459,14 @@ async def test_open_calls_ignored_in_tests(caplog: pytest.LogCaptureFixture) ->
|
||||
pass
|
||||
|
||||
assert "Detected blocking call to open with args" not in caplog.text
|
||||
|
||||
|
||||
async def test_protect_loop_set_default_verify_paths(
|
||||
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""Test SSLContext.set_default_verify_paths calls in the loop are logged."""
|
||||
with patch.object(block_async_io, "_IN_TESTS", False):
|
||||
block_async_io.enable()
|
||||
context = ssl.create_default_context()
|
||||
context.set_default_verify_paths()
|
||||
assert "Detected blocking call to set_default_verify_paths" in caplog.text
|
||||
|
||||
Reference in New Issue
Block a user