Update import locations in tests (#122216)

This commit is contained in:
Marc Mueller 2024-07-20 11:16:04 +02:00 committed by GitHub
parent 0637e342f6
commit a6068dcdf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 131 additions and 125 deletions

View file

@ -2,6 +2,7 @@
import asyncio
from collections.abc import Iterator
import subprocess
import threading
from unittest.mock import patch
@ -169,21 +170,21 @@ def test_enable_posix_spawn() -> None:
yield from packaging.tags.parse_tag("cp311-cp311-musllinux_1_1_x86_64")
with (
patch.object(runner.subprocess, "_USE_POSIX_SPAWN", False),
patch.object(subprocess, "_USE_POSIX_SPAWN", False),
patch(
"homeassistant.runner.packaging.tags.sys_tags",
side_effect=_mock_sys_tags_musl,
),
):
runner._enable_posix_spawn()
assert runner.subprocess._USE_POSIX_SPAWN is True
assert subprocess._USE_POSIX_SPAWN is True
with (
patch.object(runner.subprocess, "_USE_POSIX_SPAWN", False),
patch.object(subprocess, "_USE_POSIX_SPAWN", False),
patch(
"homeassistant.runner.packaging.tags.sys_tags",
side_effect=_mock_sys_tags_any,
),
):
runner._enable_posix_spawn()
assert runner.subprocess._USE_POSIX_SPAWN is False
assert subprocess._USE_POSIX_SPAWN is False