Skip to content

Commit 3249625

Browse files
committed
fix for older openai libs
1 parent 8d6b739 commit 3249625

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/integrations/openai/test_openai.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import pytest
2-
import openai
2+
3+
try:
4+
from openai import NOT_GIVEN
5+
except ImportError:
6+
NOT_GIVEN = None
7+
38
from openai import AsyncOpenAI, OpenAI, AsyncStream, Stream, OpenAIError
49
from openai.types import CompletionUsage, CreateEmbeddingResponse, Embedding
510
from openai.types.chat import ChatCompletion, ChatCompletionMessage, ChatCompletionChunk
@@ -1392,7 +1397,7 @@ async def test_streaming_responses_api_async(
13921397

13931398
@pytest.mark.parametrize(
13941399
"tools",
1395-
[[], None, openai.NOT_GIVEN if hasattr(openai, "NOT_GIVEN") else None],
1400+
[[], None, NOT_GIVEN],
13961401
)
13971402
def test_empty_tools_in_chat_completion(sentry_init, capture_events, tools):
13981403
sentry_init(

0 commit comments

Comments
 (0)