Skip to content

Commit 14c1d13

Browse files
committed
Disable Responses tests again. Also take care of slash at the end of Foundry endpoint
1 parent 46236ba commit 14c1d13

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ def get_openai_client(self, **kwargs) -> "OpenAI": # type: ignore[name-defined]
146146
"azure.identity package not installed. Please install it using 'pip install azure.identity'"
147147
) from e
148148

149-
openai_base_url = self._config.endpoint + "/openai" # pylint: disable=protected-access
149+
base_url = self._config.endpoint.rstrip("/") + "/openai" # pylint: disable=protected-access
150150

151151
if "default_query" not in kwargs:
152152
kwargs["default_query"] = {"api-version": "2025-11-15-preview"}
153153

154154
logger.debug( # pylint: disable=specify-parameter-names-in-call
155155
"[get_openai_client] Creating OpenAI client using Entra ID authentication, base_url = `%s`", # pylint: disable=line-too-long
156-
openai_base_url,
156+
base_url,
157157
)
158158

159159
http_client = None
@@ -262,7 +262,7 @@ def _log_request_body(self, request: httpx.Request) -> None:
262262
self._config.credential, # pylint: disable=protected-access
263263
"https://ai.azure.com/.default",
264264
),
265-
base_url=openai_base_url,
265+
base_url=base_url,
266266
http_client=http_client,
267267
**kwargs,
268268
)

sdk/ai/azure-ai-projects/azure/ai/projects/aio/_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async def get_openai_client(self, **kwargs) -> "AsyncOpenAI": # type: ignore[na
131131
"azure.identity package not installed. Please install it using 'pip install azure.identity'"
132132
) from e
133133

134-
base_url = self._config.endpoint + "/openai" # pylint: disable=protected-access
134+
base_url = self._config.endpoint.rstrip("/") + "/openai" # pylint: disable=protected-access
135135

136136
if "default_query" not in kwargs:
137137
kwargs["default_query"] = {"api-version": "2025-11-15-preview"}

sdk/ai/azure-ai-projects/tests/responses/test_responses.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@
88
# import os
99
import pytest
1010
from test_base import TestBase, servicePreparer, recorded_by_proxy_httpx
11+
from devtools_testutils import is_live_and_not_recording
1112

1213

14+
@pytest.mark.skipif(
15+
condition=(not is_live_and_not_recording()),
16+
reason="Skipped because we cannot record network calls with OpenAI client",
17+
)
1318
class TestResponses(TestBase):
1419

1520
# To run this test:

sdk/ai/azure-ai-projects/tests/responses/test_responses_async.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
# cSpell:disable
77

88
import pytest
9+
from devtools_testutils import is_live_and_not_recording
910
from test_base import TestBase, recorded_by_proxy_async_httpx, servicePreparer
1011

1112

13+
@pytest.mark.skipif(
14+
condition=(not is_live_and_not_recording()),
15+
reason="Skipped because we cannot record network calls with OpenAI client",
16+
)
1217
class TestResponsesAsync(TestBase):
1318

1419
# To run this test:

0 commit comments

Comments
 (0)