@@ -274,22 +274,22 @@ async def mock_acreate(*args, **kwargs):
274274
275275
276276@pytest .fixture (scope = "function" )
277- def mock_default_azure_credential (mock_session_env ):
277+ def mock_azure_credential (mock_session_env ):
278278 """Mock the Azure credential for testing."""
279- with mock .patch ("azure.identity.DefaultAzureCredential " ) as mock_default_azure_credential :
280- mock_default_azure_credential .return_value = MockAzureCredential ()
281- yield mock_default_azure_credential
279+ with mock .patch ("azure.identity.AzureDeveloperCliCredential " ) as mock_azure_credential :
280+ mock_azure_credential .return_value = MockAzureCredential ()
281+ yield mock_azure_credential
282282
283283
284284@pytest_asyncio .fixture (scope = "function" )
285- async def test_client (app , mock_default_azure_credential , mock_openai_embedding , mock_openai_chatcompletion ):
285+ async def test_client (app , mock_azure_credential , mock_openai_embedding , mock_openai_chatcompletion ):
286286 """Create a test client."""
287287 with TestClient (app ) as test_client :
288288 yield test_client
289289
290290
291291@pytest_asyncio .fixture (scope = "function" )
292- async def db_session (mock_session_env , mock_default_azure_credential ):
292+ async def db_session (mock_session_env , mock_azure_credential ):
293293 """Create a new database session with a rollback at the end of the test."""
294294 engine = await create_postgres_engine_from_env ()
295295 async_sesion = async_sessionmaker (autocommit = False , autoflush = False , bind = engine )
@@ -302,10 +302,10 @@ async def db_session(mock_session_env, mock_default_azure_credential):
302302
303303
304304@pytest_asyncio .fixture (scope = "function" )
305- async def postgres_searcher (mock_session_env , mock_default_azure_credential , db_session , mock_openai_embedding ):
305+ async def postgres_searcher (mock_session_env , mock_azure_credential , db_session , mock_openai_embedding ):
306306 from fastapi_app .postgres_searcher import PostgresSearcher
307307
308- openai_embed_client = await create_openai_embed_client (mock_default_azure_credential )
308+ openai_embed_client = await create_openai_embed_client (mock_azure_credential )
309309
310310 yield PostgresSearcher (
311311 db_session = db_session ,
0 commit comments