|
16 | 16 | ) |
17 | 17 | from temporalio.testing import WorkflowEnvironment |
18 | 18 | from temporalio.worker import Worker |
19 | | -from tests.helpers import assert_eq_eventually, print_interleaved_histories |
20 | 19 | from tests.helpers.nexus import create_nexus_endpoint, make_nexus_endpoint_name |
21 | 20 |
|
22 | 21 |
|
@@ -93,9 +92,6 @@ async def check_behavior_for_abandon( |
93 | 92 | Check that a cancellation request is not sent. |
94 | 93 | """ |
95 | 94 | await asyncio.sleep(0.5) |
96 | | - |
97 | | - await print_interleaved_histories(caller_wf, handler_wf) |
98 | | - |
99 | 95 | handler_status = (await handler_wf.describe()).status |
100 | 96 | assert handler_status == WorkflowExecutionStatus.RUNNING |
101 | 97 | await _assert_event_subsequence( |
@@ -144,7 +140,6 @@ async def check_behavior_for_wait_cancellation_completed( |
144 | 140 | """ |
145 | 141 | handler_status = (await handler_wf.describe()).status |
146 | 142 | assert handler_status == WorkflowExecutionStatus.CANCELED |
147 | | - await print_interleaved_histories(caller_wf, handler_wf) |
148 | 143 | await _assert_event_subsequence( |
149 | 144 | [ |
150 | 145 | (caller_wf, EventType.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED), |
@@ -198,9 +193,11 @@ async def test_cancellation_type( |
198 | 193 | task_queue=worker.task_queue, |
199 | 194 | ) |
200 | 195 | operation_token = (await caller_wf.result()).operation_token |
201 | | - handler_wf = nexus.WorkflowHandle.from_token( |
202 | | - operation_token |
203 | | - )._to_client_workflow_handle(client) |
| 196 | + handler_wf = ( |
| 197 | + nexus.WorkflowHandle[None] |
| 198 | + .from_token(operation_token) |
| 199 | + ._to_client_workflow_handle(client) |
| 200 | + ) |
204 | 201 |
|
205 | 202 | if input.cancellation_type == workflow.NexusOperationCancellationType.ABANDON: |
206 | 203 | await check_behavior_for_abandon(caller_wf, handler_wf) |
@@ -258,9 +255,3 @@ def _event_time( |
258 | 255 | ), |
259 | 256 | None, |
260 | 257 | ), f"Expected {expected_event_type_name} in {expected_handle.id}" |
261 | | - |
262 | | - |
263 | | -async def _assert_has_event_eventually( |
264 | | - wf_handle: WorkflowHandle, event_type: EventType.ValueType |
265 | | -) -> None: |
266 | | - await assert_eq_eventually(True, lambda: _has_event(wf_handle, event_type)) |
0 commit comments