remove @pytest.mark.asyncio

This commit is contained in:
Matthew Farrellee 2025-08-19 12:31:27 -04:00
parent eb07a0f86a
commit ec06956970

View file

@ -45,7 +45,6 @@ from llama_stack.providers.inline.agents.meta_reference.responses.utils import (
class TestConvertChatChoiceToResponseMessage: class TestConvertChatChoiceToResponseMessage:
@pytest.mark.asyncio
async def test_convert_string_content(self): async def test_convert_string_content(self):
choice = OpenAIChoice( choice = OpenAIChoice(
message=OpenAIAssistantMessageParam(content="Test message"), message=OpenAIAssistantMessageParam(content="Test message"),
@ -61,7 +60,6 @@ class TestConvertChatChoiceToResponseMessage:
assert isinstance(result.content[0], OpenAIResponseOutputMessageContentOutputText) assert isinstance(result.content[0], OpenAIResponseOutputMessageContentOutputText)
assert result.content[0].text == "Test message" assert result.content[0].text == "Test message"
@pytest.mark.asyncio
async def test_convert_text_param_content(self): async def test_convert_text_param_content(self):
choice = OpenAIChoice( choice = OpenAIChoice(
message=OpenAIAssistantMessageParam( message=OpenAIAssistantMessageParam(
@ -78,12 +76,10 @@ class TestConvertChatChoiceToResponseMessage:
class TestConvertResponseContentToChatContent: class TestConvertResponseContentToChatContent:
@pytest.mark.asyncio
async def test_convert_string_content(self): async def test_convert_string_content(self):
result = await convert_response_content_to_chat_content("Simple string") result = await convert_response_content_to_chat_content("Simple string")
assert result == "Simple string" assert result == "Simple string"
@pytest.mark.asyncio
async def test_convert_text_content_parts(self): async def test_convert_text_content_parts(self):
content = [ content = [
OpenAIResponseInputMessageContentText(text="First part"), OpenAIResponseInputMessageContentText(text="First part"),
@ -98,7 +94,6 @@ class TestConvertResponseContentToChatContent:
assert isinstance(result[1], OpenAIChatCompletionContentPartTextParam) assert isinstance(result[1], OpenAIChatCompletionContentPartTextParam)
assert result[1].text == "Second part" assert result[1].text == "Second part"
@pytest.mark.asyncio
async def test_convert_image_content(self): async def test_convert_image_content(self):
content = [OpenAIResponseInputMessageContentImage(image_url="https://example.com/image.jpg", detail="high")] content = [OpenAIResponseInputMessageContentImage(image_url="https://example.com/image.jpg", detail="high")]
@ -111,7 +106,6 @@ class TestConvertResponseContentToChatContent:
class TestConvertResponseInputToChatMessages: class TestConvertResponseInputToChatMessages:
@pytest.mark.asyncio
async def test_convert_string_input(self): async def test_convert_string_input(self):
result = await convert_response_input_to_chat_messages("User message") result = await convert_response_input_to_chat_messages("User message")
@ -119,7 +113,6 @@ class TestConvertResponseInputToChatMessages:
assert isinstance(result[0], OpenAIUserMessageParam) assert isinstance(result[0], OpenAIUserMessageParam)
assert result[0].content == "User message" assert result[0].content == "User message"
@pytest.mark.asyncio
async def test_convert_function_tool_call_output(self): async def test_convert_function_tool_call_output(self):
input_items = [ input_items = [
OpenAIResponseInputFunctionToolCallOutput( OpenAIResponseInputFunctionToolCallOutput(
@ -135,7 +128,6 @@ class TestConvertResponseInputToChatMessages:
assert result[0].content == "Tool output" assert result[0].content == "Tool output"
assert result[0].tool_call_id == "call_123" assert result[0].tool_call_id == "call_123"
@pytest.mark.asyncio
async def test_convert_function_tool_call(self): async def test_convert_function_tool_call(self):
input_items = [ input_items = [
OpenAIResponseOutputMessageFunctionToolCall( OpenAIResponseOutputMessageFunctionToolCall(
@ -154,7 +146,6 @@ class TestConvertResponseInputToChatMessages:
assert result[0].tool_calls[0].function.name == "test_function" assert result[0].tool_calls[0].function.name == "test_function"
assert result[0].tool_calls[0].function.arguments == '{"param": "value"}' assert result[0].tool_calls[0].function.arguments == '{"param": "value"}'
@pytest.mark.asyncio
async def test_convert_response_message(self): async def test_convert_response_message(self):
input_items = [ input_items = [
OpenAIResponseMessage( OpenAIResponseMessage(
@ -173,7 +164,6 @@ class TestConvertResponseInputToChatMessages:
class TestConvertResponseTextToChatResponseFormat: class TestConvertResponseTextToChatResponseFormat:
@pytest.mark.asyncio
async def test_convert_text_format(self): async def test_convert_text_format(self):
text = OpenAIResponseText(format=OpenAIResponseTextFormat(type="text")) text = OpenAIResponseText(format=OpenAIResponseTextFormat(type="text"))
result = await convert_response_text_to_chat_response_format(text) result = await convert_response_text_to_chat_response_format(text)
@ -181,14 +171,12 @@ class TestConvertResponseTextToChatResponseFormat:
assert isinstance(result, OpenAIResponseFormatText) assert isinstance(result, OpenAIResponseFormatText)
assert result.type == "text" assert result.type == "text"
@pytest.mark.asyncio
async def test_convert_json_object_format(self): async def test_convert_json_object_format(self):
text = OpenAIResponseText(format={"type": "json_object"}) text = OpenAIResponseText(format={"type": "json_object"})
result = await convert_response_text_to_chat_response_format(text) result = await convert_response_text_to_chat_response_format(text)
assert isinstance(result, OpenAIResponseFormatJSONObject) assert isinstance(result, OpenAIResponseFormatJSONObject)
@pytest.mark.asyncio
async def test_convert_json_schema_format(self): async def test_convert_json_schema_format(self):
schema_def = {"type": "object", "properties": {"test": {"type": "string"}}} schema_def = {"type": "object", "properties": {"test": {"type": "string"}}}
text = OpenAIResponseText( text = OpenAIResponseText(
@ -204,7 +192,6 @@ class TestConvertResponseTextToChatResponseFormat:
assert result.json_schema["name"] == "test_schema" assert result.json_schema["name"] == "test_schema"
assert result.json_schema["schema"] == schema_def assert result.json_schema["schema"] == schema_def
@pytest.mark.asyncio
async def test_default_text_format(self): async def test_default_text_format(self):
text = OpenAIResponseText() text = OpenAIResponseText()
result = await convert_response_text_to_chat_response_format(text) result = await convert_response_text_to_chat_response_format(text)
@ -214,27 +201,22 @@ class TestConvertResponseTextToChatResponseFormat:
class TestGetMessageTypeByRole: class TestGetMessageTypeByRole:
@pytest.mark.asyncio
async def test_user_role(self): async def test_user_role(self):
result = await get_message_type_by_role("user") result = await get_message_type_by_role("user")
assert result == OpenAIUserMessageParam assert result == OpenAIUserMessageParam
@pytest.mark.asyncio
async def test_system_role(self): async def test_system_role(self):
result = await get_message_type_by_role("system") result = await get_message_type_by_role("system")
assert result == OpenAISystemMessageParam assert result == OpenAISystemMessageParam
@pytest.mark.asyncio
async def test_assistant_role(self): async def test_assistant_role(self):
result = await get_message_type_by_role("assistant") result = await get_message_type_by_role("assistant")
assert result == OpenAIAssistantMessageParam assert result == OpenAIAssistantMessageParam
@pytest.mark.asyncio
async def test_developer_role(self): async def test_developer_role(self):
result = await get_message_type_by_role("developer") result = await get_message_type_by_role("developer")
assert result == OpenAIDeveloperMessageParam assert result == OpenAIDeveloperMessageParam
@pytest.mark.asyncio
async def test_unknown_role(self): async def test_unknown_role(self):
result = await get_message_type_by_role("unknown") result = await get_message_type_by_role("unknown")
assert result is None assert result is None