Skip to content

Commit 7c8e774

Browse files
committed
Fix assertions about client-side cancellation / failure errors
1 parent 895e3b1 commit 7c8e774

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/worker/test_workflow.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5491,7 +5491,12 @@ async def _run_workflow_and_get_warning(self) -> bool:
54915491

54925492
with pytest.raises(WorkflowFailureError) as err:
54935493
await handle.result()
5494-
assert str(err.value).lower() == "workflow execution failed"
5494+
assert isinstance(
5495+
err.value.cause,
5496+
{"cancellation": CancelledError, "failure": ApplicationError}[
5497+
self.workflow_termination_type
5498+
],
5499+
)
54955500

54965501
unfinished_handler_warning_emitted = any(
54975502
issubclass(w.category, self._unfinished_handler_warning_cls)

0 commit comments

Comments
 (0)