From a4d4fc6827cf924f82e3565905cf52d834c7b625 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 3 Jul 2024 23:15:26 -0500 Subject: [PATCH] Fix blocking I/O in stream tests (#121142) --- tests/components/stream/test_recorder.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/components/stream/test_recorder.py b/tests/components/stream/test_recorder.py index 515f3fff82d..c2229219422 100644 --- a/tests/components/stream/test_recorder.py +++ b/tests/components/stream/test_recorder.py @@ -305,7 +305,5 @@ async def test_record_stream_rotate(hass: HomeAssistant, filename, h264_video) - # Assert assert os.path.exists(filename) - with open(filename, "rb") as rotated_mp4: - assert_mp4_has_transform_matrix( - rotated_mp4.read(), stream.dynamic_stream_settings.orientation - ) + data = await hass.async_add_executor_job(Path(filename).read_bytes) + assert_mp4_has_transform_matrix(data, stream.dynamic_stream_settings.orientation)