Skip to content

Commit cd9d002

Browse files
cowork-bot: fix ruff lint and format in test_dispatch_streaming
1 parent 243b18a commit cd9d002

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

tests/test_dispatch_streaming.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
from __future__ import annotations
1010

1111
import subprocess
12-
import sys
13-
from unittest import mock
14-
15-
from typer.testing import CliRunner
16-
1712
from devforge.cli import app
13+
from typer.testing import CliRunner
14+
from unittest import mock
1815

1916
runner = CliRunner()
2017

@@ -49,18 +46,18 @@ def test_dispatch_does_not_buffer_output(self, _mock_installed):
4946
"all output. Use subprocess.Popen or stdout=None to stream."
5047
)
5148
assert call_kwargs.get("stdout") is not subprocess.PIPE, (
52-
"dispatch uses stdout=PIPE which buffers output. "
53-
"Use stdout=None to inherit the parent's stdout."
49+
"dispatch uses stdout=PIPE which buffers output. Use stdout=None to inherit the parent's stdout."
5450
)
5551

5652
@mock.patch("devforge.cli._is_tool_installed", return_value=True)
5753
def test_dispatch_uses_popen_or_inherited_fds(self, _mock_installed):
5854
"""dispatch should use subprocess.Popen for real-time streaming,
5955
or subprocess.run without capture (stdout=None, stderr=None).
6056
"""
61-
with mock.patch("devforge.cli.subprocess.Popen") as mock_popen, \
62-
mock.patch("devforge.cli.subprocess.run") as mock_run:
63-
57+
with (
58+
mock.patch("devforge.cli.subprocess.Popen") as mock_popen,
59+
mock.patch("devforge.cli.subprocess.run") as mock_run,
60+
):
6461
# Set up Popen mock to simulate a successful run
6562
mock_proc = mock.MagicMock()
6663
mock_proc.wait.return_value = 0
@@ -79,9 +76,7 @@ def test_dispatch_uses_popen_or_inherited_fds(self, _mock_installed):
7976
assert kwargs.get("capture_output") is not True
8077
assert kwargs.get("stdout") is not subprocess.PIPE
8178
else:
82-
raise AssertionError(
83-
"Neither subprocess.Popen nor subprocess.run was called"
84-
)
79+
raise AssertionError("Neither subprocess.Popen nor subprocess.run was called")
8580

8681
@mock.patch("devforge.cli._is_tool_installed", return_value=True)
8782
def test_dispatch_exit_code_propagates(self, _mock_installed):

0 commit comments

Comments
 (0)