Skip to content

Commit d0abce0

Browse files
committed
fix test mocks
1 parent a7fa6b4 commit d0abce0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/uipath/tests/cli/test_run.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ def _middleware_continue():
1818
)
1919

2020

21+
async def _empty_async_gen(*args, **kwargs):
22+
"""An async generator that yields nothing (simulates empty runtime.stream)."""
23+
return
24+
yield # noqa: unreachable - makes this an async generator
25+
26+
2127
def _make_mock_factory(entrypoints: list[str]):
2228
"""Create a mock runtime factory with given entrypoints."""
2329
mock_factory = Mock()
@@ -27,6 +33,7 @@ def _make_mock_factory(entrypoints: list[str]):
2733

2834
mock_runtime = Mock()
2935
mock_runtime.execute = AsyncMock(return_value=Mock(status="SUCCESSFUL"))
36+
mock_runtime.stream = Mock(side_effect=_empty_async_gen)
3037
mock_runtime.dispose = AsyncMock()
3138
mock_factory.new_runtime = AsyncMock(return_value=mock_runtime)
3239

@@ -189,12 +196,6 @@ def test_autodiscover_entrypoint(self, runner: CliRunner, temp_dir: str):
189196
"uipath._cli.cli_run.ResourceOverwritesContext",
190197
side_effect=_mock_resource_overwrites_context,
191198
),
192-
patch(
193-
"uipath._cli.cli_run.LiveTrackingSpanProcessor",
194-
),
195-
patch(
196-
"uipath._cli.cli_run.LlmOpsHttpExporter",
197-
),
198199
):
199200
result = runner.invoke(cli, ["run"])
200201

0 commit comments

Comments
 (0)