Skip to content

Commit 0b8a0bd

Browse files
committed
Add assertion that instance is non-None
1 parent 49be3d1 commit 0b8a0bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/worker/test_interceptor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,10 @@ class WorkflowInstanceAccessInboundInterceptor(WorkflowInboundInterceptor):
296296
async def execute_workflow(self, input: ExecuteWorkflowInput) -> int:
297297
# Return integer difference between ids of workflow instance obtained from workflow run method and
298298
# from workflow.instance(). They should be the same, so the difference should be 0.
299+
from_workflow_instance_api = workflow.instance()
300+
assert from_workflow_instance_api is not None
301+
id_from_workflow_instance_api = id(from_workflow_instance_api)
299302
id_from_workflow_run_method = await super().execute_workflow(input)
300-
id_from_workflow_instance_api = id(workflow.instance())
301303
return id_from_workflow_run_method - id_from_workflow_instance_api
302304

303305

0 commit comments

Comments
 (0)