diff --git a/pytest.ini b/pytest.ini index 479894a8..f2a7ece8 100644 --- a/pytest.ini +++ b/pytest.ini @@ -10,6 +10,7 @@ filterwarnings = ignore::DeprecationWarning:pkg_resources.* ignore::DeprecationWarning:setuptools.* ignore::PendingDeprecationWarning + ignore:The bot client is deprecated and will be removed in a future release\.:DeprecationWarning # pytest-asyncio warnings that are safe to ignore ignore:.*deprecated.*asyncio.*:DeprecationWarning:pytest_asyncio.* diff --git a/tests/hosting_teams/test_teams_agent_extension.py b/tests/hosting_teams/test_teams_agent_extension.py index f16b514d..c677c68c 100644 --- a/tests/hosting_teams/test_teams_agent_extension.py +++ b/tests/hosting_teams/test_teams_agent_extension.py @@ -5,21 +5,28 @@ import re import sys +from importlib.util import find_spec import pytest from unittest.mock import AsyncMock, MagicMock, patch is_supported_version = sys.version_info >= (3, 12) +is_teams_installed = ( + is_supported_version and find_spec("microsoft_agents.hosting.teams") is not None +) pytestmark = pytest.mark.skipif( - not is_supported_version, - reason="microsoft-agents-hosting-teams tests require Python 3.12+", + not is_teams_installed, + reason=( + "microsoft-agents-hosting-teams tests require Python 3.12+ and the " + "microsoft-agents-hosting-teams package" + ), ) from microsoft_agents.activity import Activity, ActivityTypes from microsoft_agents.hosting.core import TurnContext from microsoft_agents.hosting.core.app import AgentApplication, RouteRank -if is_supported_version: +if is_teams_installed: from microsoft_agents.activity.teams import ( MeetingParticipantsEventDetails, ReadReceiptInfo,