fix(tests): hoist azure-identity import out of the OBO test timeout window (#4176)

This commit is contained in:
Bill Easton 2026-05-20 08:35:56 -05:00 committed by GitHub
commit 11951585c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: