diff --git a/scripts/release.py b/scripts/release.py index 4e5b19322..0c021633b 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -82,6 +82,7 @@ AUTHOR_MAP = { "brooklyn.bb.nicholson@gmail.com": "brooklynnicholson", "4317663+helix4u@users.noreply.github.com": "helix4u", "331214+counterposition@users.noreply.github.com": "counterposition", + "blspear@gmail.com": "BrennerSpear", "gpickett00@gmail.com": "gpickett00", "mcosma@gmail.com": "wakamex", "clawdia.nash@proton.me": "clawdia-nash", diff --git a/tests/gateway/test_discord_channel_prompts.py b/tests/gateway/test_discord_channel_prompts.py index d29180cbd..9c475bded 100644 --- a/tests/gateway/test_discord_channel_prompts.py +++ b/tests/gateway/test_discord_channel_prompts.py @@ -8,6 +8,26 @@ from unittest.mock import AsyncMock, MagicMock import pytest + +def _ensure_discord_mock(): + if "discord" in sys.modules and hasattr(sys.modules["discord"], "__file__"): + return + discord_mod = types.ModuleType("discord") + discord_mod.Intents = MagicMock() + discord_mod.Intents.default.return_value = MagicMock() + discord_mod.DMChannel = type("DMChannel", (), {}) + discord_mod.Thread = type("Thread", (), {}) + discord_mod.ForumChannel = type("ForumChannel", (), {}) + discord_mod.Interaction = object + ext_mod = MagicMock() + commands_mod = MagicMock() + commands_mod.Bot = MagicMock + ext_mod.commands = commands_mod + sys.modules.setdefault("discord", discord_mod) + sys.modules.setdefault("discord.ext", ext_mod) + sys.modules.setdefault("discord.ext.commands", commands_mod) + + import gateway.run as gateway_run from gateway.config import Platform from gateway.platforms.base import MessageEvent @@ -37,6 +57,7 @@ def _install_fake_agent(monkeypatch): def _make_adapter(): + _ensure_discord_mock() from gateway.platforms.discord import DiscordAdapter adapter = object.__new__(DiscordAdapter)