Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions tests/contrib/openai_agents/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@
TestModelProvider,
)
from temporalio.contrib.pydantic import pydantic_data_converter
from temporalio.exceptions import ApplicationError, CancelledError, TemporalError
from temporalio.exceptions import (
ActivityError,
ApplicationError,
CancelledError,
TemporalError,
)
from temporalio.testing import WorkflowEnvironment
from temporalio.workflow import ActivityConfig
from tests.contrib.openai_agents.research_agents.research_manager import (
Expand Down Expand Up @@ -1352,7 +1357,6 @@ async def test_output_guardrail(client: Client, use_local_model: bool):
OutputGuardrailWorkflow.run,
id=f"output-guardrail-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10),
)
result = await workflow_handle.result()

Expand Down Expand Up @@ -1407,7 +1411,6 @@ async def test_workflow_method_tools(client: Client):
WorkflowToolWorkflow.run,
id=f"workflow-tool-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10),
)
await workflow_handle.result()

Expand Down Expand Up @@ -1469,10 +1472,12 @@ def status_error(status: int) -> ModelResponse:
"Input",
id=f"workflow-tool-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10),
)
with pytest.raises(WorkflowFailureError):
with pytest.raises(WorkflowFailureError) as err:
await workflow_handle.result()
assert isinstance(err.value.cause, ActivityError)
assert isinstance(err.value.cause.cause, ApplicationError)
assert err.value.cause.cause.type == "APIStatusError"

found = False
async for event in workflow_handle.fetch_history_events():
Expand Down Expand Up @@ -1591,7 +1596,6 @@ async def test_chat_completions_model(client: Client):
WorkflowToolWorkflow.run,
id=f"workflow-tool-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10),
)
await workflow_handle.result()

Expand Down Expand Up @@ -1664,7 +1668,6 @@ async def test_alternative_model(client: Client):
"Hello",
id=f"alternative-model-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10),
)
await workflow_handle.result()

Expand All @@ -1690,7 +1693,6 @@ async def test_heartbeat(client: Client, env: WorkflowEnvironment):
"Tell me about recursion in programming.",
id=f"workflow-tool-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=5.0),
)
await workflow_handle.result()

Expand Down Expand Up @@ -1722,7 +1724,6 @@ async def test_session(client: Client):
SessionWorkflow.run,
id=f"session-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10.0),
retry_policy=RetryPolicy(maximum_attempts=1),
)

Expand Down Expand Up @@ -1767,7 +1768,6 @@ async def test_lite_llm(client: Client):
"Tell me about recursion in programming",
id=f"lite-llm-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10),
)
await workflow_handle.result()

Expand Down Expand Up @@ -2215,7 +2215,6 @@ async def test_multiple_models(client: Client):
False,
id=f"multiple-model-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10),
)
await workflow_handle.result()
assert provider.model_names == {None, "gpt-4o-mini"}
Expand All @@ -2240,7 +2239,6 @@ async def test_run_config_models(client: Client):
True,
id=f"run-config-model-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10),
)
await workflow_handle.result()

Expand Down Expand Up @@ -2297,7 +2295,6 @@ async def test_dict_run_config_models(client: Client):
DictRunConfigWorkflow.run,
id=f"dict-run-config-model-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10),
)
result = await workflow_handle.result()

Expand Down Expand Up @@ -2354,7 +2351,6 @@ def provide(
"Prompt",
id=f"summary-provider-model-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10),
)
await workflow_handle.result()
async for e in workflow_handle.fetch_history_events():
Expand Down Expand Up @@ -2410,7 +2406,6 @@ async def test_output_type(client: Client):
OutputTypeWorkflow.run,
id=f"output-type-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=10),
)
result = await workflow_handle.result()
assert isinstance(result, OutputType)
Expand Down Expand Up @@ -2859,7 +2854,6 @@ async def test_local_hello_world_agent(client: Client):
"Tell me about recursion in programming.",
id=f"hello-workflow-{uuid.uuid4()}",
task_queue=worker.task_queue,
execution_timeout=timedelta(seconds=5),
)
result = await handle.result()
assert result == "test"
Expand Down
Loading