Skip to content

Commit 394daff

Browse files
committed
fixed tests
1 parent 2f5a3df commit 394daff

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

tests/custom_metric/workflow_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import uuid
2+
from concurrent.futures import ThreadPoolExecutor
23

34
from temporalio import activity
45
from temporalio.client import Client
@@ -22,6 +23,7 @@ async def print_message_mock():
2223
task_queue=_TASK_QUEUE,
2324
workflows=[StartTwoActivitiesWorkflow],
2425
activities=[print_message_mock],
26+
activity_executor=ThreadPoolExecutor(5),
2527
):
2628
result = await client.execute_workflow(
2729
StartTwoActivitiesWorkflow.run,

tests/hello/hello_activity_choice_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@
2020
]
2121

2222

23-
@pytest.mark.asyncio
2423
@pytest.mark.parametrize(
2524
"activity_func, order_amount, expected_result", activity_test_data
2625
)
27-
async def test_order_fruit(activity_func, order_amount, expected_result):
26+
def test_order_fruit(activity_func, order_amount, expected_result):
2827
activity_environment = ActivityEnvironment()
2928

30-
result = await activity_environment.run(activity_func, order_amount)
29+
result = activity_environment.run(activity_func, order_amount)
3130

3231
assert result == expected_result

tests/hello/hello_activity_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import uuid
2+
from concurrent.futures import ThreadPoolExecutor
23

34
from temporalio import activity
45
from temporalio.client import Client
@@ -18,6 +19,7 @@ async def test_execute_workflow(client: Client):
1819
client,
1920
task_queue=task_queue_name,
2021
workflows=[GreetingWorkflow],
22+
activity_executor=ThreadPoolExecutor(5),
2123
activities=[compose_greeting],
2224
):
2325
assert "Hello, World!" == await client.execute_workflow(

tests/hello/hello_cancellation_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import uuid
3+
from concurrent.futures import ThreadPoolExecutor
34

45
import pytest
56
from temporalio.client import Client, WorkflowExecutionStatus, WorkflowFailureError
@@ -21,6 +22,7 @@ async def test_cancel_workflow(client: Client):
2122
task_queue=task_queue_name,
2223
workflows=[CancellationWorkflow],
2324
activities=[cleanup_activity, never_complete_activity],
25+
activity_executor=ThreadPoolExecutor(5),
2426
):
2527
handle = await client.start_workflow(
2628
CancellationWorkflow.run,

0 commit comments

Comments
 (0)