Files
Molecule AI Dev Engineer A (Kimi) 03dd6a14f8 test(e2e): use DiscordAdapter's discord module in helpers instead of global patch
The previous fix (patching DiscordAdapter.__init__.__globals__) caused 50
test failures because mutating the module dict leaked across tests on the
same xdist worker — gateway tests that ran after e2e tests saw the e2e
mock instead of the comprehensive mock.

Replace the global patch with a helper `_discord_for_helpers()` that reads
`discord` from DiscordAdapter's own globals.  make_fake_dm_channel,
make_fake_thread, and make_discord_message now use that helper, ensuring
`isinstance` checks always match without side effects.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 14:52:03 +00:00
..