Skip to content

Commit c338ec2

Browse files
committed
Fix openai test uncaught exception
1 parent 4d1a32f commit c338ec2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/mlmodel_openai/test_chat_completion_stream_error.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ def test_chat_completion_invalid_request_error_no_model(set_trace_info):
114114
set_trace_info()
115115
add_custom_attribute("llm.conversation_id", "my-awesome-id")
116116
with WithLlmCustomAttributes({"context": "attr"}):
117-
generator = openai.ChatCompletion.create(
118-
# no model provided,
119-
messages=_test_openai_chat_completion_messages,
120-
temperature=0.7,
121-
max_tokens=100,
122-
stream=True,
123-
)
124117
with pytest.raises(openai.InvalidRequestError):
118+
generator = openai.ChatCompletion.create(
119+
# no model provided,
120+
messages=_test_openai_chat_completion_messages,
121+
temperature=0.7,
122+
max_tokens=100,
123+
stream=True,
124+
)
125125
for resp in generator:
126126
assert resp
127127

0 commit comments

Comments
 (0)