mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 23:37:34 +00:00
Patch at import point instead of subprocess.run
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
9f72d5e428
commit
696c0f021c
@@ -557,10 +557,8 @@ def test_run_external_process_line_callbacks() -> None:
|
||||
return "PROCESS CALLBACK\n"
|
||||
return None
|
||||
|
||||
with patch("subprocess.run") as mock_run:
|
||||
mock_run.return_value = MagicMock(returncode=0)
|
||||
with patch("esphome.util.subprocess.run") as mock_run:
|
||||
|
||||
# Capture the RedirectText objects passed to subprocess.run
|
||||
def run_side_effect(*args: Any, **kwargs: Any) -> MagicMock:
|
||||
# Simulate subprocess writing to the stdout RedirectText
|
||||
stdout = kwargs.get("stdout")
|
||||
|
||||
Reference in New Issue
Block a user