Skip to content

Commit 9f3db53

Browse files
committed
Remove a few live openai tests, the models don't always do what they need to
1 parent 2db10e3 commit 9f3db53

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

tests/contrib/openai_agents/test_openai.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,20 +1960,14 @@ async def run(self, question: str) -> str:
19601960
return result.final_output
19611961

19621962

1963-
@pytest.mark.parametrize("use_local_model", [True, False])
1964-
async def test_code_interpreter_tool(client: Client, use_local_model):
1965-
if not use_local_model and not os.environ.get("OPENAI_API_KEY"):
1966-
pytest.skip("No openai API key")
1967-
1963+
async def test_code_interpreter_tool(client: Client):
19681964
new_config = client.config()
19691965
new_config["plugins"] = [
19701966
openai_agents.OpenAIAgentsPlugin(
19711967
model_params=ModelActivityParameters(
19721968
start_to_close_timeout=timedelta(seconds=60)
19731969
),
19741970
model_provider=TestModelProvider(CodeInterpreterModel())
1975-
if use_local_model
1976-
else None,
19771971
)
19781972
]
19791973
client = Client(**new_config)
@@ -1990,8 +1984,7 @@ async def test_code_interpreter_tool(client: Client, use_local_model):
19901984
execution_timeout=timedelta(seconds=60),
19911985
)
19921986
result = await workflow_handle.result()
1993-
if use_local_model:
1994-
assert result == "Over 9000"
1987+
assert result == "Over 9000"
19951988

19961989

19971990
class HostedMCPModel(StaticTestModel):
@@ -2062,20 +2055,14 @@ def approve(_: MCPToolApprovalRequest) -> MCPToolApprovalFunctionResult:
20622055
return result.final_output
20632056

20642057

2065-
@pytest.mark.parametrize("use_local_model", [True, False])
2066-
async def test_hosted_mcp_tool(client: Client, use_local_model):
2067-
if not use_local_model and not os.environ.get("OPENAI_API_KEY"):
2068-
pytest.skip("No openai API key")
2069-
2058+
async def test_hosted_mcp_tool(client: Client):
20702059
new_config = client.config()
20712060
new_config["plugins"] = [
20722061
openai_agents.OpenAIAgentsPlugin(
20732062
model_params=ModelActivityParameters(
20742063
start_to_close_timeout=timedelta(seconds=120)
20752064
),
20762065
model_provider=TestModelProvider(HostedMCPModel())
2077-
if use_local_model
2078-
else None,
20792066
)
20802067
]
20812068
client = Client(**new_config)
@@ -2092,8 +2079,7 @@ async def test_hosted_mcp_tool(client: Client, use_local_model):
20922079
execution_timeout=timedelta(seconds=120),
20932080
)
20942081
result = await workflow_handle.result()
2095-
if use_local_model:
2096-
assert result == "Some language"
2082+
assert result == "Some language"
20972083

20982084

20992085
class AssertDifferentModelProvider(ModelProvider):

0 commit comments

Comments
 (0)