Fix event loop blocking I/O in command_line tests (#121098)
This commit is contained in:
parent
5029da6919
commit
4881205831
1 changed files with 2 additions and 3 deletions
|
@ -3,6 +3,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
@ -78,9 +79,7 @@ async def test_command_line_output(hass: HomeAssistant) -> None:
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
NOTIFY_DOMAIN, "test3", {"message": message}, blocking=True
|
NOTIFY_DOMAIN, "test3", {"message": message}, blocking=True
|
||||||
)
|
)
|
||||||
with open(filename, encoding="UTF-8") as handle:
|
assert message == await hass.async_add_executor_job(Path(filename).read_text)
|
||||||
# the echo command adds a line break
|
|
||||||
assert message == handle.read()
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue