Hy, my goal is to patch the function I am calling inside a wf, this function is not an activity, just a regular async function. My test setup is similar to what you guys have in examples.
When I am trying to patch this func like this:
async def test_wf(client: Client):
with patch(
"workflow.execute_something",
new_callable=AsyncMock
) as mock_execute_something:
mock_execute_something.return_value = 'invalid_response'
task_queue_name = config.TEMPORAL_PYTHON_TASK_QUEUE
worker = Worker(
client,
task_queue=task_queue_name,
workflows=WORKFLOWS,
activities=ACTIVITIES,
)
async with worker:
handle = await client.start_workflow(
MyWorkflow.run,
params,
id=str(uuid.uuid4()),
task_queue=task_queue_name
)
but the function is not patched for some reason.