From 2333b7a7ec682c999d9bfa9dd96ce8c293c86330 Mon Sep 17 00:00:00 2001 From: Aamir Jawaid Date: Fri, 1 May 2026 06:26:57 +0000 Subject: [PATCH] fix(tests): patch TypingActivityInput after mock on Python <3.12 The SDK requires Python >=3.12 so CI (3.11) falls to the except ImportError branch, leaving TypingActivityInput=None. After loading the adapter module, explicitly restore it from the mock so test_send_typing doesn't silently no-op. Co-Authored-By: Claude Sonnet 4.6 --- tests/gateway/test_teams.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/gateway/test_teams.py b/tests/gateway/test_teams.py index 28442788a5..0e1e05bd1b 100644 --- a/tests/gateway/test_teams.py +++ b/tests/gateway/test_teams.py @@ -169,6 +169,13 @@ _teams_mod = load_plugin_adapter("teams") _teams_mod.TEAMS_SDK_AVAILABLE = True _teams_mod.AIOHTTP_AVAILABLE = True +# Ensure SDK symbols that were None (import failed on Python <3.12) are +# replaced with the mocked versions so runtime calls don't silently no-op. +import sys as _sys +_mt = _sys.modules.get("microsoft_teams.api.activities.typing") +if _mt and _teams_mod.TypingActivityInput is None: + _teams_mod.TypingActivityInput = _mt.TypingActivityInput + TeamsAdapter = _teams_mod.TeamsAdapter check_requirements = _teams_mod.check_requirements check_teams_requirements = _teams_mod.check_teams_requirements