test: reset gateway.platforms.discord state before every test #30
Reference in New Issue
Block a user
Delete Branch "fix/e2e-discord-xdist-isolation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
test_discord_imports.pydeletes and re-importsgateway.platforms.discordwithDISCORD_AVAILABLE=False, corrupting state for every subsequent discord test in the same xdist worker—including e2e tests that importDiscordAdapter.Fix
Add a reset block to the root
_reset_module_stateautouse fixture (which already clears ~10 other module-level caches) so the flag and module reference are restored before every test.Verification
LGTM, resets discord state before each test to fix e2e flakiness.