Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add aoai assistants streaming/v2 tests #35443

Merged
merged 9 commits into from
Jun 7, 2024
13 changes: 12 additions & 1 deletion sdk/openai/azure-openai/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
DefaultAzureCredential as AsyncDefaultAzureCredential,
get_bearer_token_provider as get_bearer_token_provider_async,
)
from ci_tools.variables import in_ci


# for pytest.parametrize
GA = "2024-02-01"
PREVIEW = "2024-03-01-preview"
PREVIEW = "2024-05-01-preview"
LATEST = PREVIEW

AZURE = "azure"
Expand Down Expand Up @@ -65,8 +66,15 @@
ENV_OPENAI_TTS_MODEL = "tts-1"


def skip_openai_test(api_type) -> bool:
return in_ci() and "openai" in api_type and "tests-weekly" not in os.getenv("SYSTEM_DEFINITIONNAME", "")


@pytest.fixture
def client(api_type, api_version):
if skip_openai_test(api_type):
pytest.skip("Skipping openai tests - they only run on tests-weekly.")

if api_type == "azure":
client = openai.AzureOpenAI(
azure_endpoint=os.getenv(ENV_AZURE_OPENAI_ENDPOINT),
Expand Down Expand Up @@ -100,6 +108,9 @@ def client(api_type, api_version):

@pytest.fixture
def client_async(api_type, api_version):
if skip_openai_test(api_type):
pytest.skip("Skipping openai tests - they only run on tests-weekly.")

if api_type == "azure":
client = openai.AsyncAzureOpenAI(
azure_endpoint=os.getenv(ENV_AZURE_OPENAI_ENDPOINT),
Expand Down
Loading