diff --git a/scripts/manageacl.py b/scripts/manageacl.py index 347b3df3bd..6b49ae4b75 100644 --- a/scripts/manageacl.py +++ b/scripts/manageacl.py @@ -2,6 +2,7 @@ import asyncio import json import logging +from typing import Union from azure.core.credentials import AzureKeyCredential from azure.core.credentials_async import AsyncTokenCredential @@ -27,7 +28,7 @@ def __init__( acl_action: str, acl_type: str, acl: str, - credentials: AsyncTokenCredential | AzureKeyCredential, + credentials: Union[AsyncTokenCredential, AzureKeyCredential], ): """ Initializes the command diff --git a/tests/conftest.py b/tests/conftest.py index e96936f1a0..5502886518 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,6 @@ import argparse import json +import os from collections import namedtuple from unittest import mock @@ -168,7 +169,8 @@ async def client(monkeypatch, mock_openai_chatcompletion, mock_openai_embedding, monkeypatch.setenv("AZURE_OPENAI_CHATGPT_MODEL", "gpt-35-turbo") for key, value in request.param.items(): monkeypatch.setenv(key, value) - monkeypatch.delenv("AZURE_USE_AUTHENTICATION") + if os.getenv("AZURE_USE_AUTHENTICATION") is not None: + monkeypatch.delenv("AZURE_USE_AUTHENTICATION") with mock.patch("app.DefaultAzureCredential") as mock_default_azure_credential: mock_default_azure_credential.return_value = MockAzureCredential()