Skip to content

Commit

Permalink
fix expected n logs
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Nov 11, 2024
1 parent 621e81a commit 5076803
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/integrations/prefect-shell/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,15 @@ async def test_output(self, prefect_task_runs_caplog, method):
async def test_stream_output(self, prefect_task_runs_caplog, method):
# If stream_output is False, there should be output,
# but no logs from the shell process
prefect_task_runs_caplog.set_level(logging.INFO) # Only capture INFO logs

op = ShellOperation(
commands=["echo 'testing\nthe output'", "echo good"], stream_output=False
)
assert await self.execute(op, method) == ["testing", "the output", "good"]
records = prefect_task_runs_caplog.records
records = [
r for r in prefect_task_runs_caplog.records if r.levelno >= logging.INFO
]
assert len(records) == 2
assert "triggered with 2 commands running" in records[0].message
assert "completed with return code 0" in records[1].message
Expand Down

0 comments on commit 5076803

Please sign in to comment.