From 11951585c0156908c2e148c40e09a1ce0751c5b4 Mon Sep 17 00:00:00 2001 From: Bill Easton Date: Wed, 20 May 2026 08:35:56 -0500 Subject: [PATCH] fix(tests): hoist azure-identity import out of the OBO test timeout window (#4176) --- tests/server/auth/providers/test_azure_scopes.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/server/auth/providers/test_azure_scopes.py b/tests/server/auth/providers/test_azure_scopes.py index 8ab35431d..5f1bb6b18 100644 --- a/tests/server/auth/providers/test_azure_scopes.py +++ b/tests/server/auth/providers/test_azure_scopes.py @@ -12,6 +12,14 @@ from fastmcp.server.auth.providers.azure import ( ) from fastmcp.server.auth.providers.jwt import RSAKeyPair, StaticTokenVerifier +# Import the optional azure-identity SDK once, at collection time. The OBO +# tests mock it via patch("azure.identity.aio.OnBehalfOfCredential"), but the +# provider imports it lazily — so without this the heavy SDK import lands +# inside the first OBO test's 5s pytest-timeout window and flakes on cold +# Windows runners (#4175). importorskip also skips cleanly if the optional +# `azure` extra is absent, instead of hard-failing at runtime. +pytest.importorskip("azure.identity.aio") + @pytest.fixture def memory_storage() -> MemoryStore: